Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

javascript problem


Reply


5 Posts   684 Views

Avatar
Webdoc

Community Member, 333 Posts

25 October 2009 at 6:09pm

Edited: 25/10/2009 6:14pm

added jquery elastic trumpnail video but it uses the jquery script that dont run
<script type="text/javascript">
$(document).ready(function() {
   $('.menueitem img').animate( {width: 125}, 0);
   $('.menueitem').mouseover(function(){
   gridimage = $(this).find('img');
   gridimage.stop().animate( {width: 150}, 150);
   }).mouseout(function(){ gridimage.stop().animate({width: 125}, 125);
});
});
</script>

and also not if i add it as .js

<script type="text/javascript" src="tooted.js"></script>

how can it be fixed

in here it doesnt work its silverstripe - http://www.alpinacolor.ee/tooted/

and in here it work just php file http://www.chillweb.eu/asaal/

Avatar
Willr

Forum Moderator, 5513 Posts

25 October 2009 at 6:26pm

Make sure you are developing with firebug (firefox plugin) enabled. Helps debugging these things. You have an error "$(".menuitem img") is null so I'm guessing that $(".menuitem") is returning an empty set.

Avatar
Webdoc

Community Member, 333 Posts

25 October 2009 at 6:29pm

Have any idea what it is because in my own server it works fine only in silverstripe it gives error

Avatar
Willr

Forum Moderator, 5513 Posts

25 October 2009 at 6:41pm

SS would be loading its own JS so it could be due to a conflict. Make sure your JS is wrapped in a closure like - http://doc.silverstripe.org/doku.php?id=jquery#guidelines

Avatar
Webdoc

Community Member, 333 Posts

25 October 2009 at 6:55pm

found the solution thanx willr.