jQuery Style Switcher

How To Create An Amazing jQuery Style Switcher

Tutorial Details
  • Difficulty: Intermediate
  • Completion Time: 30 Minutes

In this tutorial I will be showing you how to create a style switcher using jQuery and PHP. The end result will be an unobtrusive & entirely degradable dynamic style switcher which will be quick and easy to implement.

Step 1: The HTML

First, we need to create our basic HTML file and save it as index.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Style Switcher</title>
		<?php
			// Checks for, and assigns cookie to local variable:
			if(!empty($_COOKIE['style'])) $style = $_COOKIE['style'];
			// If no cookie is present then set style as "day" (default):
			else $style = 'day';
		?>

		<!-- StyleSheet -->
		<link id="stylesheet" type="text/css" href="css/<?php echo $style ?>.css" rel="stylesheet" />

		<!-- jQuery -->
		<script type="text/javascript" src="js/jquery.js"></script>

		<!-- Our plugin -->
		<script type="text/javascript" src="js/styleswitcher.jquery.js"></script>

	</head>
	<body>
		<div id="container">
			<h1>Style-Switcher Example</h1>
			<ul id="nav">
				<li><a href="#">Home</a></li>
				<li><a href="#">About</a></li>
				<li><a href="#">Services</a></li>
				<li><a href="#">Products</a></li>
				<li><a href="#">Links</a></li>
				<li><a href="#">Contact</a></li>
			</ul>
			<div id="banner"></div>
			<div id="content">
				<h2>NETTUTS Tutorial Example</h2>
				<p>Page content...</p>
			</div>
			<div id="foot">
				<p>Footer stuff...</p>
			</div>

			<!-- StyleSheet selection: -->
			<div id="style-switcher">
				<h4>Choose your style:</h4>
				<ul>
					<li id="day"><a href="style-switcher.php?style=day">Day</a></li>
					<li id="night"><a href="style-switcher.php?style=night">Night</a></li>
				</ul>
			</div>

		</div>

		<script type="text/javascript">
			$('#style-switcher a').styleSwitcher(); // Calling the plugin...
		</script>

	</body>
</html>

You’ll see that there is some PHP up there just below the title attribute in the head. It’s very simple – all it does is check for a cookie called “style” – if it exists then it assigns it to the local variable (also called “style”) and if the cookie doesn’t exist, it assigns the default theme (“day”) to the $style variable. This variable is then echoed out within the href attribute of the link element (href="css/<?php echo $style ?>.css").

You’ll see that the style-switcher div is included above in our HTML. There is no need to add this using JavaScript because the method we’re using will allow the style-switcher to work when JavaScript is disabled. The two links (night & day) take the user to a file called style-switcher.php with an appended query string specifying the corresponding theme (e.g. href="style-switcher.php?style=day").

I’ve also called the a jQuery plugin called styleSwitcher. This has not been developed yet (well, it will have by the time you read this), so hold on! … We will be writing this plugin in step 4 of this tutorial.

Step 2: The CSS

Now, we need to create a couple of CSS StyleSheets for our HTML. I’ve decided to create just two StyleSheets – one will have the theme of “Day” and the other will have the theme of “Night” and I’ve named them appropriately. (day.css & night.css)

The Day theme:

Night Theme

The Night theme:

Night Theme

It’s best to start with one style and then copy across all the selectors to the alternative StyleSheet – and then all that needs changing are the various CSS rules and declarations. Obviously you can have as many StyleSheets as you want but in this tutorial we’re using two for illustrative purposes. Plus night and day go well together as a duo!

day.css:

#dummy-element{width:2px;} /* Necessary to check if StyleSheet has loaded */

/* Quick Reset */
body,ul,ol,li,img,form,p,h1,h2,h3,h4,h5,h6,blockquote {
	margin: 0;
	padding: 0;
	border: none;
	list-style: none;
	font-weight: normal;
}

/* General / Header */
body {background: #98beeb url(../img/day-body-bg.jpg) repeat-x; }
#container {
	width: 60%;
	margin: 0 auto;
	min-width: 400px;
	max-width: 800px;
	position: relative;
}
h1 {
	text-align: left;
	text-transform: uppercase;
	color: white;
	font-size: 1.4em;
	padding: 45px 30px 10px 30px;
}

/* Navigation */
#nav {
	padding: 5px 5px 0 0;
	overflow: hidden;
}
#nav li {display: inline;}
#nav a {
	float: left;
	color: #6195ce;
	font-weight: bold;
	text-decoration: none;
	padding: 3px 6px;
	margin-left: 5px;
	background: white;
}
#nav a:hover {color: #2c5a8c;}

/* Banner */
#banner {
	height: 125px;
	background: url(../img/day-banner.jpg) center;
	border: 5px solid white;
	clear: both;
}

/* Content Area */
#content {
	border: 10px solid white;
	background: white;
	color: #2c5a8c;
	margin: 5px 0;
}
#content a {font-weight: bold;}
#content a:hover {text-decoration: underline;}
h2 {
	padding: 0.3em 0;
	font-size: 1.4em;
}
p {padding: 0.3em 0;}

/* Footer */
#foot {
	background: white;
	color: #1f3a57;
	text-align: center;
	border: 10px solid white;
	clear: both;
}
#foot a {
	text-decoration: none;
	font-weight: bold;
	color: #2c5a8c;
}
#foot a:hover {text-decoration: underline;}

/* Style-Switcher */
#style-switcher {
	position: absolute;
	width: 100%;
	top: 0;
	left: 0;
	right: 0;
	height: 34px;
	background: #79a3cc url(../img/day-ss-bg.jpg);
	border-bottom: 1px solid white;
}
#style-switcher ul {
	border-right: 1px solid white;
	float: right;
}
#style-switcher h4 {
	display: inline;
	color: #153c67;
	font-weight: bold;
	line-height: 34px;
	padding: 0 10px;
	float: left;
	border-left: 1px solid white;
}
#style-switcher li {display: inline;}
#style-switcher li a {
	float: left;
	line-height: 26px;
	color: white;
	background: #90a6bb;
	text-decoration: none;
	padding: 0 13px;
	display: inline;
	margin: 4px 4px 4px 0;
}
#style-switcher li a:hover {background: #3a5a7c;}

night.css:

#dummy-element{width:2px;} /* Necessary to check if StyleSheet has loaded */

/* Quick Reset */
body,ul,ol,li,img,form,p,h1,h2,h3,h4,h5,h6,blockquote {
	margin: 0;
	padding: 0;
	border: none;
	list-style: none;
	font-weight: normal;
}

/* General / Header */
body {
	font-family: Calibri,"Arial Narrow",Arial,Sans-Serif;
	background: #072952 url(../img/night-body-bg.jpg) repeat-x;
}
#container {
	width: 60%;
	margin: 0 auto;
	min-width: 400px;
	max-width: 800px;
	position: relative;
}
h1 {
	text-align: left;
	text-transform: uppercase;
	color: white;
	font-size: 1.4em;
	padding: 45px 30px 10px 30px;
	font-family: "Times New Roman", Times, serif;
}

/* Navigation */
#nav {
	padding: 5px 5px 0 0;
	overflow: hidden;
}
#nav li {display: inline;}
#nav a {
	float: left;
	color: #010e2e;
	font-weight: bold;
	text-decoration: none;
	padding: 8px 6px 3px 6px;
	font-size: 0.8em;
	text-transform: uppercase;
	font-weight: 700;
	margin-left: 5px;
	background: white url(../img/night-nav-bg2.jpg) repeat-x;
}
#nav a:hover {color: #2c5a8c;}

/* Banner */
#banner {
	height: 125px;
	background: url(../img/night-banner.jpg) center;
	border: 5px solid white;
	clear: both;
}

/* Content Area */
#content {
	color: white;
	margin: 20px 0;
	padding: 5px 0;
	border-top: 4px double white;
	border-bottom: 4px double white;
	font-family: "Times New Roman", Times, serif;
}
#content a {font-weight: bold;}
#content a:hover {text-decoration: underline;}
h2 {
	padding: 0.3em 0;
	font-size: 1.4em;
}
p {padding: 0.3em 0;}

/* Footer */
#foot {
	color: white;
	font-size: 0.8em;
	clear: both;
}
#foot p {
	text-align: center;
	padding: 0;
}
#foot a {
	text-decoration: none;
	font-weight: bold;
	color: white;
}
#foot a:hover {text-decoration: underline;}

/* Style-Switcher */
#style-switcher {
	position: absolute;
	width: 100%;
	top: 0;
	left: 0;
	right: 0;
	height: 34px;
}
#style-switcher ul {float: left;}
#style-switcher h4 {
	display: inline;
	color: white;
	font-weight: bold;
	line-height: 34px;
	padding: 0 10px;
	float: left;
}
#style-switcher li {display: inline;}
#style-switcher li a {
	float: left;
	line-height: 34px;
	color: white;
	text-decoration: none;
	padding: 0 4px;
	margin-left: 5px;
	display: inline;
}
#style-switcher li a:hover {
	background: white;
	color: #13181c;
	background: white url(../img/night-ss-bg.jpg) repeat-x left bottom;
}

This is not really a CSS tutorial so I won’t be delving into any of the above, but if you have any questions then please feel free to ask them in the comments section. And yes, I know that min-width is not supported in older browsers! ;)

Step 3: style-switcher.php

This is where we write the core functionality of the style switcher. It is actually just a few lines of very basic PHP code. You should create a new file called “style-switcher.php” and copy the following into it:

<?php
	$style = $_GET['style'];
	setcookie("style", $style, time()+604800); // 604800 = amount of seconds in one week
	if(isset($_GET['js'])) {
		echo $style;
	} else {
		header("Location: ".$_SERVER['HTTP_REFERER']);
	}
?>

So, what the above code does is assign the “style” GET variable to a local $style variable. In other words it will take the value of the style property within the query string (style-switcher.php?style=day). It then sets a cookie (for one week) called “style” – we will be able to retrieve this cookie on our main index.php with the code shown in step 1 (remember that little chunk of PHP in the head?). Next, it checks to see if “js” is appended to the query string. If it is then we know that JavaScript (which we have yet to write) has requested this PHP script. The else condition occurs when a user does not have JavaScript enabled and redirects the user to the referrer (i.e. the page they just came from) – this will become clearer once we’ve written the jQuery stuff!

Step 4: The jQuery stuff

You can, if you want, stop right here!… The solution thus far will work perfectly, but as I stated in the intro we are going to make it even cooler with some jQuery awesomeness! Not only are we going to allow the user to change their theme without refreshing the page but we are also going to add a really cool fading effect… I mean, what type of jQuery tutorial would this be if there was no fading!?!?

Obviously this is all possible without having to create a plugin but I thought it would be a good learning experience for all you, plus it allows us to adapt or transfer the code quickly and easily.

First off, let’s create a file called “styleswitcher.jquery.js”.

Making a new plugin in jQuery is extremely simple; all it takes is the following code:

jQuery.fn.styleSwitcher = function(){
	// The code goes here...
}

So, first we want to specify what happens when one of the StyleSheet links are clicked on (those within div#style-switcher):

/* "this" refers to each instance of the selected element,
 * So, if you were to call the plugin like this:
 * $('a').styleSwitcher(); then the following would occur
 * when clicking on any anchor within the document:
 */

$(this).click(function(){
	// We're passing this element object through to the
	// loadStyleSheet function.
	loadStyleSheet(this);
	// And then we're returning false.
	return false;
});

loadStyleSheet:

Now we need to write the loadStyleSheet function:

function loadStyleSheet(obj) {

	// Append new div to body:
	$('body').append('<div id="overlay" />');

	// Give body a height of 100% (to fix IE6 issue):
	$('body').css({height:'100%'});

	// Select newly created div and apply some styles:
	$('#overlay')
		.css({
			display: 'none',
			position: 'absolute',
			top:0,
			left: 0,
			width: '100%',
			height: '100%',
			zIndex: 1000,
			background: 'black url(img/loading.gif) no-repeat center'
		})

		// Now fade in the div (#overlay):
		.fadeIn(500,function(){

			// The following will happen when the div has finished fading in:

			// Request PHP script (obj.href) with appended "js" query string item:
			$.get( obj.href+'&js',function(data){

				// Select link element in HEAD of document (#stylesheet) and change href attribute:
				$('#stylesheet').attr('href','css/' + data + '.css');

				// Check if new CSS StyleSheet has loaded:
				cssDummy.check(function(){

					// When StyleSheet has loaded, fade out and remove the #overlay div:
					$('#overlay').fadeOut(500,function(){
						$(this).remove();
					});
				});
			});
		});
}

I hope the comments explained it sufficiently. The more attentive of you will have noticed that we are calling a currently undefined function (cssDummy.check()). Don’t worry because that is the next step…

cssDummy:

We need a way of testing whether a StyleSheet has loaded. If it has loaded then we can make the overlay div disappear, but if it hasn’t we have to keep on checking until it does load. I did a bit of searching around the net and found a reliable way of testing such a thing. It involves testing for the computed width of a dummy element. The width of this element will be defined in the CSS – and so the computed width of the element will only equal the width defined in the CSS when the StyleSheet has loaded. I hope you now understand why we had to include that “#dummy-element” rule in each CSS file…

So, here it is:

var cssDummy = {
	init: function(){
		// Appends "dummy-element" div to body:
		$('<div id="dummy-element" style="display:none" />').appendTo('body');
	},
	check: function(callback) {

		// Checks if computed with equals that which is defined in the StyleSheets (2px):
		if ($('#dummy-element').width()==2) callback();

		// If it has not loaded yet then simple re-initiate this
		// function every 200 milliseconds until it had loaded:
		else setTimeout(function(){cssDummy.check(callback)}, 200);
	}
}

And, right at the end of our plugin we’re going to call the cssDummy.init function:

cssDummy.init();

We’re done! The entire plugin now looks like this:

jQuery.fn.styleSwitcher = function(){
	$(this).click(function(){
		loadStyleSheet(this);
		return false;
	});
	function loadStyleSheet(obj) {
		$('body').append('<div id="overlay" />');
		$('body').css({height:'100%'});
		$('#overlay')
			.css({
				display: 'none',
				position: 'absolute',
				top:0,
				left: 0,
				width: '100%',
				height: '100%',
				zIndex: 1000,
				background: 'black url(img/loading.gif) no-repeat center'
			})
			.fadeIn(500,function(){
				$.get( obj.href+'&js',function(data){
					$('#stylesheet').attr('href','css/' + data + '.css');
					cssDummy.check(function(){
						$('#overlay').fadeOut(500,function(){
							$(this).remove();
						});
					});
				});
			});
	}
	var cssDummy = {
		init: function(){
			$('<div id="dummy-element" style="display:none" />').appendTo('body');
		},
		check: function(callback) {
			if ($('#dummy-element').width()==2) callback();
			else setTimeout(function(){cssDummy.check(callback)}, 200);
		}
	}
	cssDummy.init();
}

We can now call the jQuery plugin like this:

$('#style-switcher a').styleSwitcher();

Finished!

If you’re not sure about the file structure then download the src files to have a look. I hope you enjoyed reading through this tutorial. As always, if you have any questions feel free to ask them below! If you enjoyed this posting, please Digg it!


James Padolsey is JimmyP on Codecanyon
Tags: jQuery
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.descon.co.za Eugene

    Do you think it would be possible to modify this with maybe some other jQuery plugins to make it a draggable element that slots into another element and then engaging the style switch.

    As an example, you’re designing a website for a an electrical company and you want the stylesheet dark with just a electrical plug showing and a wall socket, as soon as you drag it into place and plug it in, the style switches to a bright stylesheet as it is now powered.

    Just a thought…

  • Pingback: The Best jQuery Plugins | Website Design | Harmonic Design

  • Mitch

    Interesting!
    Works great but the moment I have my CSS and JS files one level downline – usually ../css … nothing works anymore.

    Yes I did change the path in the styleswitcher.jquery.js file and yes I also corrected the to the style-switcher.php file which I moved to the directory ../php/ …

    If that’ too confusing, here is a sample of my directory structure:
    root/directory/sample.php
    root/css/mycssfiles.css
    root/js/myjsfiles.js
    root/php/myphpfiles.php

    the sample.php file I wanted to apply the the style switching to.

    Weird. Something silly, stupid me.. what am I missing?

  • http://www.myproperty.com.pk Khalil

    :-) Awesome Tutorial.

  • Maksudul Haque

    Great Example…………………..

  • http://www.handcraftedwebsites.co.uk/ Cottage Stuff

    Like Mitch I am having a problem once the files are not in the same directory and I am having another problem when you have to scroll down before clicking the styleswitching link because then the overlay doesn’t properly fill the browser window (Firefox 3.6), so I am giving up for the time being and taking the easy way out. In case anyone else wants to do likewise here is what I put in the head of my page (let’s call it pagewithstyleswitch.php):

    <link type="text/css" href=".css” rel=”stylesheet”> .

    Then make the links to switch styles like so:

    Another style #2
    Yet another style #3
    .

    Simple stuff. But some of us need (and like) it simple.

  • http://www.markvoortmedia.nl Webdesign

    Awesome tutorial. Great work and it’s very helpful for me

  • John

    Anyone get this working yet in WordPress 3.2.1?

  • Pingback: Kỹ thuật lập trình .com » Jquery Effect » 55 Jquery Tutorials, Resources, Tips And Tricks: Ultimate Collection

  • Pingback: 35+ Useful Ajax Tutorials for Web Developers « CSS Tips

  • Pingback: 50 Best jQuery Visual Tutorials Every Web Designer Must Look At | CS5 Design

  • Pingback: 50 Awesome jQuery Tutorials to Help You Design | CS5 Design

  • Pingback: 35+ Useful Ajax Tutorials for Web Developers | Tutorials Palace

  • Pingback: 10 Simple and Easy jQuery Style Switchers | jQuery4u

  • Pingback: WEBDEV CORNER by SEBASTIEN TARNOWSKI | My Blog about Web & Mobile Development

  • Divyesh

    Hello,
    I want to add style switcher in wordpress.

    my header.php code is as below.

    <link id="stylesheet" type="text/css" href="/style.css” rel=”stylesheet” />

    <link id="stylesheet" type="text/css" href="/css/.css” rel=”stylesheet” />

    <script type="text/javascript" src="/js/_cufon-replace.js”>
    <script type="text/javascript" src="/js/jquery.js”>
    <script type="text/javascript" src="/js/styleswitcher.jquery.js”>

    My style-switcher.php code is below

    My styleswitcher.jquery.js code is below

    var cssDummy = {
    init: function(){
    $(“”).appendTo(‘body’);
    },
    check: function(callback) {
    if ($(“2==2″)) callback();
    else setTimeout(function(){cssDummy.check(callback)}, 200);
    }
    }
    cssDummy.init();
    }

    AND My Body Code in header is below

    <a href="/style-switcher.php?style=Dark_Blue”><img src="/images/colorpanel_dark_blue.jpg”/>
    <a href="/style-switcher.php?style=Dark_Green”><img src="/images/colorpanel_dark_green.jpg”/>
    <a href="/style-switcher.php?style=Dark_Orange”><img src="/images/colorpanel_dark_orange.jpg”/>
    <a href="/style-switcher.php?style=Dark_Red”><img src="/images/colorpanel_dark_red.jpg”/>
    <a href="/style-switcher.php?style=Dark_Lilac”><img src="/images/colorpanel_dark_lilac.jpg”/>

    $(‘#style-switcher a’).styleSwitcher();

    can anyone tell me that where i am going wrong????

    Plz help to solve this error…

    Thanks in advance……

  • http://www.divyesh.co.in Divyesh

    Hello,

    I want to add style switcher in wordpress 3.2.1.

    my header.php code is as below.

    My style-switcher.php code is below

    $style = $_GET['style']==’Dark_Blue’) ? ‘Dark_Green’ : ‘Dark_Orange’ : ‘Dark_Red’ : ‘Dark_Lilac’ : ‘Dark_Blue’;
    setcookie(“style”, $style, time()+31622400),”/”);
    if(isset($_GET['js'])) {
    echo $style;
    } else {
    header(“Location: “.$_SERVER['HTTP_REFERER']);
    }

    My styleswitcher.jquery.js code is below

    var cssDummy = {
    init: function(){
    $(“”).appendTo(‘body’);
    },
    check: function(callback) {
    if ($(“2==2″)) callback();
    else setTimeout(function(){cssDummy.check(callback)}, 200);
    }
    }
    cssDummy.init();
    }

    AND My Body Code in header is below





    $(‘#style-switcher a’).styleSwitcher();

    Weird. Something silly, stupid me.. what am I missing?
    Thanks in advance……

  • Pingback: CSS Style Switcher for SharePoint Master page | All about MOSS

  • Pingback: Excellent Ajax Tutorial

  • http://seriouslovemeet.com divine

    hi , it sound so simple to me but being a novis in the coding world i have found it some difficult.

    can you please show me where to create the file and where to add this code >(href=”css/.css”). and other ones like that.

    thanks

  • http://www.boxtwobox.com devrupam

    Awesome tutorial and it’s very helpful.

  • Pingback: 30+ Best JQuery Tutorials | ThemesPress

  • varsh

    not working on ipad :(

    plzzzzzzz help

  • Pingback: 20 Powerful And Useful jQuery Tutorials Of Year 2011 | Easy jQuery

  • Pingback: 20 Powerful And Useful jQuery Tutorials Of Year 2011 | auto

  • navneeth

    i downloaded the jquery style switcher source file and iam unable to findout the html file .it is written as index.php but not index.html how to execute this please can you solve my problem my friend

  • Steve

    Is it possible to modify the script to handle two stylesheets – one for page layout, and one for color scheme. Allowing the user to click a link, to change either the color or layout?

  • Pingback: 25+ Best Ajax Tutorials - MegaTeacher | Let's start learning MegaTeacher | Let's start learning

  • Marko

    1st. I must say that on this web site, is a waste of time to ask for help because no one will help. It is really sad that so treat people. Do they know all about coding, they would not come to these places to learn. Tutorials serve to those who know, teach those who do not know, but here this rule is …!

    2nd. The sentence “As always, if you have any questions feel free to ask them below!” Is not true in reality.
    I had to criticize you, because you need to change this little part about helping other people.

    I must admit this is great tutorial. Thank you!

  • Pingback: 30 AJAX Tutorials For Smart Web Developers - MegaTeacher | Let's start learning MegaTeacher | Let's start learning

  • Pingback: design for the web » Blog Archive » switching styles

  • Pingback: 开发者经常用到的75 个功能强大的 jQuery插件和教程汇总(上篇) - TNM博客 - 知其然知其所以然 | 做而且还要做好 | 知足常乐

  • http://www.krutarth.com Divyesh

    I want to use style switcher in my wordpress theme.

    in my theme default style.css in theme folder like, krutarth is my theme name so KRUTARTH/style.css

    and 5 more alternate css like blue, green, red etc. which is in KRUTARTH/CSS/

    i try to following tutorial from http://net.tutsplus.com/tutorials/javascript-ajax/jquery-style-switcher/

    my style-switcher code is given below.

    .

    my header php code is given below.


    <link id="stylesheet" type="text/css" href="/style.css” rel=”stylesheet”/>

    <link id="alternate" type="text/css" href="/css/.css” rel=”stylesheet” />

    <script type="text/javascript" src="/js/_cufon-replace.js”>

    <script type="text/javascript" src="/js/crawler.js”>
    <script type="text/javascript" src="/js/jquery.js”>
    <script type="text/javascript" src="/js/styleswitcher.jquery.js”>

    jQuery(document).ready(function() {
    jQuery(“.stylespanel-toggle”).click(function(e) {
    e.preventDefault();
    jQuery(“.stylespanel-content”).slideToggle();
    });
    jQuery(“.stylespanel-content”).hide();
    });

    .

    <body >

    <a href="/style-switcher.php?style=Dark_Blue”><img src="/images/colorpanel_dark_blue.jpg”/>
    <a href="/style-switcher.php?style=Dark_Green”><img src="/images/colorpanel_dark_green.jpg”/>
    <a href="/style-switcher.php?style=Dark_Orange”><img src="/images/colorpanel_dark_orange.jpg”/>
    <a href="/style-switcher.php?style=Dark_Red”><img src="/images/colorpanel_dark_red.jpg”/>
    <a href="/style-switcher.php?style=Dark_Lilac”><img src="/images/colorpanel_dark_lilac.jpg”/>

     

    $(‘#style-switcher a’).styleSwitcher();// Calling the plugin…

    .
    so, plz can you help me out from solve this problem…

    Thanks….

    Divyesh

  • Catherine

    Oops – I forgot to add the code in the container under the sentence:

    *****And then inside the tag in your theme’s header file, add these two lines:

    <?php include ($_SERVER['DOCUMENT_ROOT'].’/stylearray.php’); ?>

    <?php include ($_SERVER['DOCUMENT_ROOT'].’/styleswitcher.php’); ?>

  • Catherine

    Oops – I forgot to add the code in the container under the sentence about the two lines in the HEAD tag:

    <?php include ($_SERVER['DOCUMENT_ROOT'].’/stylearray.php’); ?>

    <?php include ($_SERVER['DOCUMENT_ROOT'].’/styleswitcher.php’); ?>

  • Pingback: 50 common jQuery plugin tutorial demo and download Web Page Design | Web Page Design Templates | Html5 Template

  • Pingback: Web developer should not ignore such cool tips of jquery | JqueryHeaven

  • dlogic