PDA

View Full Version : how to include jquery?


drunkenkilla
09-11-2009, 04:50 PM
hello, i want to include jquery. the problem is now: it doesn't work :(

my idee is t switch the logo. the image should switch between 3 images.

i found a site where it is described: drweb.de/magazin/wp-content/uploads/ueberblenden.html

so i began to insert the code in my files. here is layout.css:

Content visible to registered users only.

and here is the header.tpl:

Content visible to registered users only.

and here the top_bar.tpl:

Content visible to registered users only.

the problem is that when i put the javascript into the header the site will return a white site with no content. when i remove the javascript i can see the images on the site but i must include the javascript.

who knows what the problem is?

bruleo
09-11-2009, 05:13 PM
If you are talking about pulling different images at random, then you are sure over-complicating things. There is some very simple smarty code that will do exactly that posted in the forums and is in use for the headers at www.sportindexer.com (http://www.sportindexer.com) and www.airindexer.com (http://www.airindexer.com), albeit with a slightly enhanced version. Refresh the page and you will see a different selection of images.

Bruce.

drunkenkilla
09-11-2009, 05:25 PM
hey this is not what i am looking for. i want the images should switch for example every 2 seconds not when i refreshed the site.

James
09-11-2009, 05:27 PM
<script type="text/javascript">
{literal}
function daumenKino() {
var $alt = $('#bilderstapel img.obersteeben');
var $neu = $alt.next().length.length ? $alt.next() : $('#bilderstapel img:first');
$alt.addClass('mittlereebene');
$alt.removeClass('obersteebene');
$neu.css({opacity: 0.0});
$neu.addClass('obersteebene');
$neu.animate({opacity: 1.0}. 2000, function(){
$alt.removeClass('mittlereebene');
});
}

$(document).ready(funtion() {
setInterval( "daumenKino()", 2000);
});
{/literal}
</script>

drunkenkilla
09-11-2009, 06:48 PM
thanks...now i can see the page but i dont see switching the images :(

drunkenkilla
09-11-2009, 07:38 PM
ok it works now ;)

David
09-12-2009, 02:00 AM
What is the url of the site where you have this jquery working now?