

* Improved the transition performance on mobile devices * Fixed problems with adding images from Flickr * New skins: Megalopolis jQuery image slider, Puzzle and Contour * Most of effects are rewritten to use the hardware-accelerated animations * Improved touch-swipe for native-like mobile experience * App interface face-lift - more flat and convenient

#Simple content switcher jquery software
See also: Icon Font, Bootstrap carousel, Form Builder, HTML5 Video, Icon Maker, Free Web Builder Software In most cases you'll get a reply within 1 business day.įirst to see if your question has already been answered. Make sure to include details on your browser, operating system, WOW jQuery Slideshow version, link to your page.
#Simple content switcher jquery code
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.įirst off, let's create a file called "". I mean, what type of jQuery tutorial would this be if there was no fading!?!? 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. the page they just came from) - this will become clearer once we've written the jQuery stuff! Step 4: The jQuery stuff The else condition occurs when a user does not have JavaScript enabled and redirects the user to the referrer (i.e. If it is then we know that JavaScript (which we have yet to write) has requested this PHP script. Next, it checks to see if "js" is appended to the query string. 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?). In other words it will take the value of the style property within the query string (style-switcher.php?style= day). So, what the above code does is assign the "style" GET variable to a local $style variable. You should create a new file called "style-switcher.php" and copy the following into it: It is actually just a few lines of very basic PHP code. This is where we write the core functionality of the style switcher. And yes, I know that min-width is not supported in older browsers! ) Step 3: style-switcher.php 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. Plus night and day go well together as a duo! day.css: #dummy-elementīackground: white url(./img/night-ss-bg.jpg) repeat-x left bottom Obviously you can have as many StyleSheets as you want but in this tutorial we're using two for illustrative purposes. 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. 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. Now, we need to create a couple of CSS StyleSheets for our HTML. We will be writing this plugin in step 4 of this tutorial. This has not been developed yet (well, it will have by the time you read this), so hold on!. I've also called the a jQuery plugin called styleSwitcher. 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. 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. You'll see that the style-switcher div is included above in our HTML. This variable is then echoed out within the href attribute of the link element ( href="css/.css"). 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. You'll see that there is some PHP up there just below the title attribute in the head. $('#style-switcher a').styleSwitcher() // Calling the plugin. First, we need to create our basic HTML file and save it as index.php:
