How to turn off a SPECIFIC javascript in EditMode?
Permalink 1 user found helpful
I have a really neat and easy little code called Cycle that rotates some slides. With the new Designer Content block, I was able to make this a functional, editable bunch of slides. Only problem is that I can't figure out how to turn Cycle script off in Edit Mode, so the Editable Area cycles and every 4 slides or so you get the "Add To" button, which you can then click to add a slide, but it's silly and I need it to stop cycling slides in edit mode.
Here's what I came up with. It did not work:
Here's what I came up with. It did not work:
<?php if ($c->isEditMode()) { ?> <!-- nothing happens --> <?php } else { ?> <!-- include Cycle plugin --> <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script> <!--Cycle slides--> <script type="text/javascript"> $('#home-slides').cycle({ fx: 'fade', timeout: 10000, delay: -2000 }); </script> <?php } ?>