Archive for the ‘JS’ Category

tsl

Cu3er Slow to Load

By Head Lounger • March 30th, 2010 • JS Tags:

If you haven’t seen this flash gallery, check it out here.

It has some very cool effects for images. I had added it to a site and it was taking FOREVER to load. After searching cu3er forum, they were of no help, just contact theme developer.

Well I did find my issue with it… Maybe it could help someone else who is using it.

The issue stemmed from the config.xml. The images were taking forever to load.

I also moved the xml file to a php file.

Step 1: Open a new file, name it something you will remember “slideshow.php”.

Inside this new file, add

<?php
header('Content-Type: text/xml');
print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>

to the top of the file.

Follow this up now with the rest of your content from the config.xml, minus the first line.

Would look something like this in the end:

<?php
header('Content-Type: text/xml');
print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>
<cu3er>
<settings>
<auto_play>
<defaults symbol="circular"/>
<tweenIn x="850" y="25" width="30" height="30" tint="0x999999" alpha="0.5"/>
<tweenOver alpha="1"/>
</auto_play>
<prev_button>
<defaults round_corners="5,5,5,5"/>
<tweenOver tint="0xFFFFFF" scaleX="1.1" scaleY="1.1"/>
<tweenOut tint="0x000000" />
</prev_button>

<prev_symbol>
<tweenOver tint="0x000000" />
</prev_symbol>

<next_button>
<defaults round_corners="5,5,5,5"/>
<tweenOver tint="0xFFFFFF"  scaleX="1.1" scaleY="1.1"/>
<tweenOut tint="0x000000" />
</next_button>

<next_symbol>
<tweenOver tint="0x000000" />
</next_symbol>    

</settings>    

<slides>

<slide>
<url>/one.jpg</url>
</slide>
<!-- changing transition between first & second slide -->
<transition num="3" slicing="vertical" direction="down"/>
<slide>
<url>/two.jpg</url>
</slide>
<!-- changing transition between second & third slide -->
<transition num="4" direction="right" shader="flat" />
<slide>
<url>/three.jpg</url>
</slide>
<!-- transitions properties defined in transitions template -->
<slide>
<url>/four.jpg</url>
</slide>
<transition num="6" slicing="vertical" direction="up" shader="flat" delay="0.05" z_multiplier="4" />
<slide>
<url>/five.jpg</url>
</slide>

</slides>
</cu3er>

Step 2: Update the call to your new file. Look for the JS that embeds the flash.

var flashvars = {};
		flashvars.xml = "/slideshow.php";

Step 3:
Now to make the update that fixed the issue.

Find in your config the following lines:

<slide>
<url>/one.jpg</url>
</slide>

This is what I originally had. The file was in the root. If your xml looks similar to this, all you need to do is add the full url to your image path. So in the end it would look like this:

<slide>
<url>http://www.yoursite.com/one.jpg</url>
</slide>

Hope that helps!

 
tsl

Remove Value onFocus in Input Box

By Head Lounger • March 14th, 2010 • JS Tags:

A nice touch to any text box on your site, is to easily remove the default text on the users “click” of that text box (‘search…’). You can add the line of code directly to your input box. It has come in handy many times in building out web pages.

Example:


<form><input type="hidden" name="phpMyAdmin" value="ku2SQBE5Ur4J7tzeVJpVfjJ7rI1" /> <input name="name" type="text" value="Search..." />
</form>

There you go. Simple and adds a touch of ease to any site.

Cheers!~