3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1051 Views |
-
[ Javascripts ] Conflic with admin section

18 January 2011 at 3:32pm
When i login on admin section of silverstripe, the javascripts don't work on website.
I htink the problem are because i use jquery and jquery-ui on my website.
Sorry my english are not very good.
-
Re: [ Javascripts ] Conflic with admin section

18 January 2011 at 4:00pm
Usually the CMS won't include any of your front end javascript. That is why have to explicitly load your javascript in the CMS.
Can you look at your web browsers error console and find the actual error. You may also what to try visiting the url - admin?flush=1&isDev=1 and try logging in. The flush is to refresh the cache, the isDev is used to disable the live mode JS minification.
-
Re: [ Javascripts ] Conflic with admin section

18 January 2011 at 4:23pm Last edited: 18 January 2011 4:27pm
The problem are when i am on Published Site and $SilverStripeNavigator are active. My jquery dont work on the Published Site
-
Re: [ Javascripts ] Conflic with admin section

18 January 2011 at 5:24pm
Ensure you javascript is in a closure - http://doc.silverstripe.org/sapphire/en/topics/javascript#custom-jquery-code
Also include the built in sapphire jQuery rather than your own to avoid duplications.
-
Re: [ Javascripts ] Conflic with admin section

19 January 2011 at 12:36am
i have my own jquery but i have already modify mod code.
<script type="text/javascript">//<![CDATA[
(function($) {
$( "#accordion" ).accordion({
header: "h3",
active: false,
collapsible: true,
autoHeight: false,
navigation: true
});
})(jQuery);$('.ppt li:gt(0)').hide();
$('.ppt li:last').addClass('last');
var cur = $('.ppt li:first');function animate() {
cur.fadeOut( 2000 );
if ( cur.attr('class') == 'last' )
cur = $('.ppt li:first');
else
cur = cur.next();
cur.fadeIn( 2000 );
}
(function($) {
setInterval( "animate()", 6000 );
} )(jQuery);
//]]></script>$SilverStripeNavigator
</body>
</html> -
Re: [ Javascripts ] Conflic with admin section

19 January 2011 at 10:53pm
All your code should be inside the 1 closure.
$('.ppt li:gt(0)').hide(); etc isn't in it.
| 1051 Views | ||
|
Page:
1
|
Go to Top |


