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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

javascript problem


Go to End


5 Posts   1043 Views

Avatar
Webdoc

Community Member, 349 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, 5523 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, 349 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, 5523 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, 349 Posts

25 October 2009 at 6:55pm

found the solution thanx willr.