Jquery changes Webpage Design (background color) in real time)

Source: Internet
Author: User

Jquery real-time Webpage Design (background color) asp "title =" Jquery real-time Webpage Design (background color) "/> demo

PHP Code
  1. Include ('conn. php ');
  2. If ($ _ SERVER ["REQUEST_METHOD"] = "POST ")
  3. {
  4. $ Background = $ _ POST ['background'];
  5. $ Header = $ _ POST ['header'];
  6. $ Sidebar = $ _ POST ['inclubar'];
  7. $ Footer = $ _ POST ['footer '];
  8. $ Links = $ _ POST ['link'];
  9. $ Text = $ _ POST ['text'];
  10. Mysql_query ("UPDATE users SET background = '$ background', header = '$ header', sidebar =' $ sidebar', footer = '$ footer ', texts = '$ text', links =' $ links 'WHERE user_id = '1 '");
  11. $ Msg = 'Design updated .';
  12. }
  13. $ SQL = mysql_query ("SELECT background, header, sidebar, footer, texts, links FROM users WHERE user_id = '1 '");
  14. $ Row = mysql_fetch_array ($ SQL );
  15. $ Background = $ row ['background'];
  16. $ Header = $ row ['header'];
  17. $ Sidebar = $ row ['inclubar'];
  18. $ Footer = $ row ['footer '];
  19. $ Text = $ row ['text'];
  20. $ Links = $ row ['link'];
  21. ?>
  22. Jquery changes Webpage Design (background color) in real time)
  23. <Script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"> </script>
  24. <Script type = "text/javascript" src = "js/colorpicker. js"> </script>
  25. <Script type = "text/javascript">
  26. $ (Document). ready (function ()
  27. {
  28. $ ('. Color'). ColorPicker ({
  29. OnSubmit: function (hsb, hex, rgb, el ){
  30. $ (El). val (hex );
  31. $ (El). ColorPickerHide ();
  32. },
  33. OnBeforeShow: function (){
  34. $ (This). ColorPickerSetColor (this. value );
  35. }
  36. })
  37. . Bind ('keyup', function (){
  38. $ (This). ColorPickerSetColor (this. value );
  39. });
  40. $ (". Colorpicker_submit"). click (function ()
  41. {
  42. Var B = $ ("# background"). val ();
  43. Var sidebar = $ ("# sidebarinput"). val ();
  44. Var header = $ ("# headerinput"). val ();
  45. Var footer = $ ("# footerinput"). val ();
  46. Var T = $ ("# textinput"). val ();
  47. Var L = $ ("# linkinput"). val ();
  48. $ ("# Header" ).css ("background-color", "#" + header );
  49. $ ("# Main_right" ).css ("background-color", "#" + sidebar );
  50. $ ("# Footer" ).css ("background-color", "#" + footer );
  51. Certificate ('body').css ("background-color", "#" + B );
  52. Certificate ('{container'}.css ("color", "#" + T );
  53. $ ('# Container a'0000.css ("color", "#" + L );
  54. });
  55. });
  56. </Script>
  57. Live Design Changing with Jquery


  58. Address: http://www.freejs.net/article_jquerywenzi_135.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.