Jump to content

Jquery Slide Toggle Best Solution.


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...