| | |
JQuery: Need Help Embedding Link in Accordion Menu
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2006
Posts: 5
Reputation:
Solved Threads: 0
Hello,
I need help with embedding links within a Jquery Accordion.
The code I am using is based on Jörn Zaefferer's JQuery Accordion plugin, with some modifications to allow for an embedded link within each accordion div. The accordion effect looks and works just fine when viewed in Safari and Firefox. However, when viewed in Explorer 6.0 and above, the accordion effect is gone and each accordion div is open and displayed instead of just one being open and the rest closed and hidden.
I suspect the problem is in the Javascript but I'm not much of a programmer so any help would be greatly appreciated.
The Javascript
The Code
Thanks!
I need help with embedding links within a Jquery Accordion.
The code I am using is based on Jörn Zaefferer's JQuery Accordion plugin, with some modifications to allow for an embedded link within each accordion div. The accordion effect looks and works just fine when viewed in Safari and Firefox. However, when viewed in Explorer 6.0 and above, the accordion effect is gone and each accordion div is open and displayed instead of just one being open and the rest closed and hidden.
I suspect the problem is in the Javascript but I'm not much of a programmer so any help would be greatly appreciated.
The Javascript
JavaScript Syntax (Toggle Plain Text)
<script type="text/javascript"> jQuery().ready(function(){ // simple accordion jQuery('#list1a').accordion({ header: '.main', }); jQuery('#list1b').accordion({ header: '.main', autoheight: false }); }); </script>
The Code
html Syntax (Toggle Plain Text)
<div class="basic" style="float:left;" id="list1a"> <a class="main">THE LINK TO OPEN THE DIV IN ACCORDION EFFECT</a> <div> <ul> <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> <li>Aliquam tincidunt mauris eu risus.</li> <li>Vestibulum auctor dapibus neque.</li> </ul> <a href="#" class="link">THE LINK I WANT TO EMBED</a> </div> <a class="main">THE LINK TO OPEN THE DIV IN ACCORDION EFFECT</a> <div> <ul> <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> <li>Aliquam tincidunt mauris eu risus.</li> <li>Vestibulum auctor dapibus neque.</li> </ul> <a href="#" class="link">THE LINK I WANT TO EMBED</a> </div> </div>
Thanks!
Last edited by peter_budo; Dec 18th, 2008 at 7:57 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jun 2006
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Hello,
I need help with embedding links within a Jquery Accordion.
The code I am using is based on Jörn Zaefferer's JQuery Accordion plugin, with some modifications to allow for an embedded link within each accordion div. The accordion effect looks and works just fine when viewed in Safari and Firefox. However, when viewed in Explorer 6.0 and above, the accordion effect is gone and each accordion div is open and displayed instead of just one being open and the rest closed and hidden.
I suspect the problem is in the Javascript but I'm not much of a programmer so any help would be greatly appreciated.
The Javascript
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<script type="text/javascript"> jQuery().ready(function(){ // simple accordion jQuery('#list1a').accordion({ header: '.main', }); jQuery('#list1b').accordion({ header: '.main', autoheight: false }); }); </script>
The Code
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<div class="basic" style="float:left;" id="list1a"> <a class="main">THE LINK TO OPEN THE DIV IN ACCORDION EFFECT</a> <div> <ul> <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> <li>Aliquam tincidunt mauris eu risus.</li> <li>Vestibulum auctor dapibus neque.</li> </ul> <a href="#" class="link">THE LINK I WANT TO EMBED</a> </div> <a class="main">THE LINK TO OPEN THE DIV IN ACCORDION EFFECT</a> <div> <ul> <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> <li>Aliquam tincidunt mauris eu risus.</li> <li>Vestibulum auctor dapibus neque.</li> </ul> <a href="#" class="link">THE LINK I WANT TO EMBED</a> </div> </div>
Thanks!
Here's the code as modified:
<script type="text/javascript">
jQuery().ready(function(){
jQuery('#list1a').accordion({
header: '.main',
authoheight: true});
jQuery('#list1b').accordion({
header: '.main',
autoheight: false
});
});
</script>![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: adding button click event in javascript
- Next Thread: How to open a pege in new window
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column createrange() css cursor date debugger dependent disablefirebug dom download dropdown editor element embed engine error events explorer ext file form forms getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe images internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl math media microsoft mimic object onmouseoutdivproblem onreadystatechange parent paypal pdf php player position post problem programming progressbar regex runtime scroll search security select shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n





