Jump to content

Jquery Slide Toggle Best Solution.


attila2452
 Share

Recommended Posts

Whats the best solution for completing this:http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.htmlthe website I'm working on.scroll down a bit and click the H4 there's a hidden content that slides out.but when multiple on page, it unfolds them all. whats my best option.the reason it opens both is because their both set to the same ID's. and i know that if i set all divs different ID's it will work. BUT what are my other options? are there any other options?here's the code:http://jsfiddle.net/attilahajzer/zx2dk/2/Please Help.

  • Like 1
Link to comment
Share on other sites

of course its going to jump up and down, IF you have 4-5 scripts carrying out the same function and producing the opposite result that the previous script applied. inline scripts found looking at page source

Inline Script from http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.html$(document).ready(function() {    $(".click").click(function() {	    $(".expand").slideToggle();    });});Inline Script from http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.html$(document).ready(function(){  $(".click").click(function(){       var target = $(this).parent().children(".expand");    $(target).slideToggle();  });});Inline Script from http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.html$(document).ready(function(){  $(".click").click(function(){       var target = $(this).parent().children(".expand");    $(target).slideToggle();  });});Inline Script from http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.html$(document).ready(function(){  $(".click").click(function(){    $(this).next(".expand").slideToggle();  });});Inline Script from http://app4.websitetonight.com/projects/2/3/9/4/2394058/Tools_for_Web_Success2.html$(document).ready(function(){  $(".click").click(function(){       var target = $(this).parent().children(".expand");    $(target).slideToggle();  });});

Link to comment
Share on other sites

The reason for this is that its on Website Tonight. and to input the script, you have to go to Insert > Script and when that opens up, it has this default text:

<script type="text/javascript" src="http://www.a.com/Example1.js"></script><script type="text/javascript">	    var JavaScriptExample = "Example 2";</script><script type="text/javascript" id="MyScript" defer="defer">	    var JavaScriptExample = "Example 3";</script><p>    <b>Script embedded in HTML</b>    <script type="text/javascript">	 var JavaScriptExample = "Example 4";    </script></p>

i have to clear that, then input my script. then save and close. refresh the preview page. when i go back into the script page, the default code goes back where i originally put my script. There's now way of me to look at or edit my javascript code, only to re-submit it again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...