<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/swap</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 01:57:26 GMT</pubDate>
<item>
<title>(C) swap: swap two numbers without using a third object( or variable) - zaxbbun</title>
<link>http://snipplr.com/view/71248/swap-swap-two-numbers-without-using-a-third-object-or-variable/</link>
<description><![CDATA[ <p>swap: swap two numbers without using the third object( or variable)</p> ]]></description>
<pubDate>Tue, 21 May 2013 16:26:27 GMT</pubDate>
<guid>http://snipplr.com/view/71248/swap-swap-two-numbers-without-using-a-third-object-or-variable/</guid>
</item>
<item>
<title>(jQuery) jQuery Image Source Swap with attr() function - vijayrajesh</title>
<link>http://snipplr.com/view/69520/jquery-image-source-swap-with-attr-function/</link>
<description><![CDATA[ <p>I have made a small jQuery snippet to demo the image swapping with attr() funciton.  The demo uses 2 images with classes img1 and img2 respectively.  On a click of a button, the images are swapped.

Basically the script stores “src” value into a variable and then it is  used to swap 2 image sources.</p> ]]></description>
<pubDate>Thu, 17 Jan 2013 22:25:58 GMT</pubDate>
<guid>http://snipplr.com/view/69520/jquery-image-source-swap-with-attr-function/</guid>
</item>
<item>
<title>(ActionScript 3) AS3 swap child, moves movieclip to top of all others - mecsekikrisztian</title>
<link>http://snipplr.com/view/50401/as3-swap-child-moves-movieclip-to-top-of-all-others/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 10 Mar 2011 01:17:25 GMT</pubDate>
<guid>http://snipplr.com/view/50401/as3-swap-child-moves-movieclip-to-top-of-all-others/</guid>
</item>
<item>
<title>(JavaScript) Swap child nodes - jatkins</title>
<link>http://snipplr.com/view/50142/swap-child-nodes/</link>
<description><![CDATA[ <p>Released into the public domain. **Update 7/20/2011: Rewritten with a method that shouldn't lose values/selected files/etc. Earlier versions based on a solution found on [Stack Overflow](http://www.stackoverflow.com).**</p> ]]></description>
<pubDate>Sun, 06 Mar 2011 02:08:53 GMT</pubDate>
<guid>http://snipplr.com/view/50142/swap-child-nodes/</guid>
</item>
<item>
<title>(MySQL) Swap values for two columns in MySQL table - fugue</title>
<link>http://snipplr.com/view/41475/swap-values-for-two-columns-in-mysql-table/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 05 Oct 2010 02:45:39 GMT</pubDate>
<guid>http://snipplr.com/view/41475/swap-values-for-two-columns-in-mysql-table/</guid>
</item>
<item>
<title>(jQuery) JQuery Expanding div with toggle - xz</title>
<link>http://snipplr.com/view/41185/jquery-expanding-div-with-toggle/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 30 Sep 2010 19:30:07 GMT</pubDate>
<guid>http://snipplr.com/view/41185/jquery-expanding-div-with-toggle/</guid>
</item>
<item>
<title>(jQuery) Content Swap - mikemetcalf</title>
<link>http://snipplr.com/view/21048/content-swap/</link>
<description><![CDATA[ <p>What it does:
Takes a navigation, and swaps out corresponding content dynamically. It will automatically assign an .active class to the active list item, and unhide the first hidden div.

How it works:
Add '.swap' to the navigation ul.
Add a '.hidden' class to each one of the corresponding divs</p> ]]></description>
<pubDate>Mon, 12 Oct 2009 12:05:04 GMT</pubDate>
<guid>http://snipplr.com/view/21048/content-swap/</guid>
</item>
<item>
<title>(CSS) css image swap - thesmu</title>
<link>http://snipplr.com/view/18311/css-image-swap/</link>
<description><![CDATA[ <p>You will see that it’s pretty basic – setting width and height attributes for the image, and basically just telling the browser “when someone hovers over the image, make it disappear” – and it simply reveals the background image for the div – your “hover” state.

This, of course, will work in all manner of ways. If you have a navigational list, simply replace the  with . You will also have to separate them – if you’re using 12 different images (6 images for the “on” state, and 6 for “off” – 2 images for each link), you’ll have to set 6 different classes for each image, since none will have the same images representing them.

So yes, it does increase your CSS filesize. But, if you’re looking for a certain type of display, and you (or your client) desires a particular font, size and color for certain elements on the site, this is an excellent alternative to using a javascript image replacement. An added bonus – users who have javascript turned off in their browsers will still see the rollover effect.

Now, keep in mind, you have to deal with IE. (yeah, I bet you weren’t expecting that!) Well, the thing with IE is, it has problems caching background images. So if you move your mouse over the above stuff in IE, it’ll change as expected – but if you move ever so slightly, you’re going to see the blue flash back over. So as you slowly move your mouse across the image, it’ll flicker “redblueredblueredblue” – which is as annoying as hell.

This is actually easy to fix. In your header (or if you’re using a conditional comment to pull in an external stylesheet for IE, simply add this line to the bottom of the IE-specific stylesheet):



You must be sure that, for IE, that the “background-position” attribute is NOT set. If you set a background-position for the div, then the flicker will reappear.

Otherwise, you’re set! Enjoy your javascript-free rollovers. :)

Tested on Windows XP: FF 1.0.7, FF2, FF3, IE 8, IE 7, IE 6.0, IE 5.5, IE 5.0, Opera 8 and Netscape 7.
Tested on Mac OSX Tiger: Safari 2.0, Mozilla Firefox 1.0.6, and IE 5.2. (that last one has a slight padding glitch, which is a result of my global stylesheet – easily fixed, if I really felt like dealing with it…but the point is, the rollover effect does work perfectly there.)
Tested on Mac OSX Leopard: FF3, Safari 3.2.1, Camino 1.6.6, Opera 9.63.</p> ]]></description>
<pubDate>Fri, 14 Aug 2009 07:12:17 GMT</pubDate>
<guid>http://snipplr.com/view/18311/css-image-swap/</guid>
</item>
<item>
<title>(ActionScript) Swap Depths - njhamann</title>
<link>http://snipplr.com/view/17739/swap-depths/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 31 Jul 2009 13:24:06 GMT</pubDate>
<guid>http://snipplr.com/view/17739/swap-depths/</guid>
</item>
<item>
<title>(ActionScript) Swap Depths - njhamann</title>
<link>http://snipplr.com/view/17738/swap-depths/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 31 Jul 2009 13:24:05 GMT</pubDate>
<guid>http://snipplr.com/view/17738/swap-depths/</guid>
</item>
<item>
<title>(jQuery) Wrap the insides of Buttons - dougunderscorenelson</title>
<link>http://snipplr.com/view/14546/wrap-the-insides-of-buttons/</link>
<description><![CDATA[ <p>Quick script to find button elements (and elements with the "button" class) and wrap their innards in spans. Good for making rounded-corner buttons.</p> ]]></description>
<pubDate>Tue, 28 Apr 2009 17:57:12 GMT</pubDate>
<guid>http://snipplr.com/view/14546/wrap-the-insides-of-buttons/</guid>
</item>
<item>
<title>(JavaScript) Paragraph First Letter Swap (Illumination) - ezerick</title>
<link>http://snipplr.com/view/9062/paragraph-first-letter-swap-illumination/</link>
<description><![CDATA[ <p>this is a combination of javascript and css and an image called letters.jpg that allows you to use any font you want for the first letter of each paragraph. Letters.jpg needs to have all the letters in uppercase in a row. See the link for a sample letters image. This function should be called on body load</p> ]]></description>
<pubDate>Thu, 16 Oct 2008 12:53:31 GMT</pubDate>
<guid>http://snipplr.com/view/9062/paragraph-first-letter-swap-illumination/</guid>
</item>
</channel>
</rss>