简体   繁体   中英

jQuery code doesn't work on Weebly - why?

newbie here. I have very limited coing skills, but OK in installing scripts to my Weebly site. Doing this for a while now and although I can not code, I learnt some things.

I would like to install a slider code I've purchased at codecanyon. Not sure if I can insert link here, but it's name is "Lush slider" you can find it at the site.

My problem is: I uploaded .js and .css files as well as images. I purchased a wysiwyg editor for the slider, and did thge slider. I have the code which I copied to the site. I can see the images before publishing but not after. it stays blank. I've found a link that Weebly might have problems with the "$" things - which I am not familiar with. Could you please help what could cause the problem?

The code I had to insert to my footer is as follows:

<script>
  $(document).ready(function(){
  $('.lush-slider').lush({
     baseWidth: 1455
   , baseHeight: 450
  })
</script>

Thanks a lot for any help!

It may just be a typo in here - but you are not closing out the document ready declaration. Also check if your site has jquery by looking for either a local reference to jquery or a CDN delivered version.

<script>
  $(document).ready(function(){
  $('.lush-slider').lush({
     baseWidth: 1455
   , baseHeight: 450
  }); // closes the lush method
}); //closes the document.ready
</script>

I also found the documentation here ( http://js.ofrance.fr/lush-content-slider/documentation/help.html ) that may help you in setting it up and also checking that the right files are called and are called in the right order.

尝试使用jQuery()而不是$()来访问它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM