Jquery real-time Webpage Design (background color) asp "title =" Jquery real-time Webpage Design (background color) "/> demo
PHP Code
- Include ('conn. php ');
- If ($ _ SERVER ["REQUEST_METHOD"] = "POST ")
- {
- $ Background = $ _ POST ['background'];
- $ Header = $ _ POST ['header'];
- $ Sidebar = $ _ POST ['inclubar'];
- $ Footer = $ _ POST ['footer '];
- $ Links = $ _ POST ['link'];
- $ Text = $ _ POST ['text'];
-
- Mysql_query ("UPDATE users SET background = '$ background', header = '$ header', sidebar =' $ sidebar', footer = '$ footer ', texts = '$ text', links =' $ links 'WHERE user_id = '1 '");
- $ Msg = 'Design updated .';
- }
-
- $ SQL = mysql_query ("SELECT background, header, sidebar, footer, texts, links FROM users WHERE user_id = '1 '");
- $ Row = mysql_fetch_array ($ SQL );
- $ Background = $ row ['background'];
- $ Header = $ row ['header'];
- $ Sidebar = $ row ['inclubar'];
- $ Footer = $ row ['footer '];
- $ Text = $ row ['text'];
- $ Links = $ row ['link'];
-
- ?>
-
-
-
-
- Jquery changes Webpage Design (background color) in real time)
-
-
-
- <Script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"> </script>
-
- <Script type = "text/javascript" src = "js/colorpicker. js"> </script>
- <Script type = "text/javascript">
- $ (Document). ready (function ()
- {
- $ ('. Color'). ColorPicker ({
- OnSubmit: function (hsb, hex, rgb, el ){
- $ (El). val (hex );
- $ (El). ColorPickerHide ();
- },
- OnBeforeShow: function (){
- $ (This). ColorPickerSetColor (this. value );
- }
- })
- . Bind ('keyup', function (){
- $ (This). ColorPickerSetColor (this. value );
- });
-
- $ (". Colorpicker_submit"). click (function ()
- {
- Var B = $ ("# background"). val ();
- Var sidebar = $ ("# sidebarinput"). val ();
- Var header = $ ("# headerinput"). val ();
- Var footer = $ ("# footerinput"). val ();
- Var T = $ ("# textinput"). val ();
- Var L = $ ("# linkinput"). val ();
-
- $ ("# Header" ).css ("background-color", "#" + header );
- $ ("# Main_right" ).css ("background-color", "#" + sidebar );
- $ ("# Footer" ).css ("background-color", "#" + footer );
- Certificate ('body').css ("background-color", "#" + B );
- Certificate ('{container'}.css ("color", "#" + T );
- $ ('# Container a'0000.css ("color", "#" + L );
-
- });
-
- });
- </Script>
-
-
-
-
-
-
-
-
-
-
-
-
-
- Live Design Changing with Jquery
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Address: http://www.freejs.net/article_jquerywenzi_135.html