close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

onLoad works on Chrome but not IE or Firefox

Thread began 12/29/2012 12:46 pm by Jared Lui | Last modified 1/02/2013 12:55 pm by Jared Lui | 2519 views | 6 replies |

Jared Lui

onLoad works on Chrome but not IE or Firefox

I'm using a Spry Accordion and have it working as intended in Chrome however both Firefox and more importantly IE only partially work. Rather than move to JQuery straight off, I'd like to see if I can fix this with the help of any experts here. Thanks in advance.

If you view this page in Chrome:
figure_lines_Detail.php?Line_Id=30

You'll notice that the accordion on the right side goes 4, 3, 2, 1 with the last panel (1) open.

When viewed in IE and FF the accordion goes 4, 3, 2, 1 however the first panel (4) is open.

I used this code to make it work in Chrome:
<body onLoad="MM_callJS('Accordion1.openLastPanel(); return false;')">

I can provide the page code and all helper files as needed. I am hoping someone will know of a IE/FF work around to save me from recreating this accordion. NOTE: This accordion has a repeat section inside a repeated section and was difficult to create so that's why I'd like to see if I can fix this Chrome vs IE/FF issue if I can.

Thanks in advance!

Sign in to reply to this post

Jason ByrnesWebAssist

see the spry documentation here:

help.html?content=WSDBFCA944-4E99-421a-9328-8533440AA7F3.html

In the navigation, the link for "Set the default open panel" says:

  You can set a certain panel to be open when the page containing the Accordion widgets loads in a browser.

Set the defaultPanel option in the constructor as follows:
<script type="text/javascript">
var acc8 = new Spry.Widget.Accordion("Accordion8", { defaultPanel: 2 });
</script>
Note: The accordion panels use a zero-based counting system, so setting the value to 2 opens the third panel.  






on your page, the code to initialize the accordion is:

<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
</script>



add ", { defaultPanel: 3 }" to that to force the forth tab to be the default open tab:

<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("Accordion1", { defaultPanel: 3 });
</script>
Sign in to reply to this post

Jared Lui

Hey Jason, thanks for the response.

I already have the link you refer to bookmarked and know about the default panel setting; however this does not apply in my case as those panels are dynamic and the number of them is not constant hence my use of "Accordion1.openLastPanel" which works perfectly in Chrome.

I'm not tech savvy enough to know why it does not work in IE/FF or how to code a similar fix for them or who or where I should ask. Any leads are appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

The Adobe Spry forums would be the best place to ask for help on this issue:
spry

Sign in to reply to this post

Jared Lui

Yeah, I have a request for help there too but since they don't really support Spry much anymore I usually have better luck here. We'll see what happens. Thanks for the response.

We must away! We must away!
We ride before the break of day!

Sign in to reply to this post

Jason ByrnesWebAssist

Heres a thought, any record set you create will have a variable to return the number of rows.

you can use that variable - 1 to set the default panel. for example:

php:
var Accordion1 = new Spry.Widget.Accordion("Accordion1", { defaultPanel: <?php echo($totalRows_recordsetName 1); ?> });




you have to subtract 1 because the panels are indexed starting at 0.

Sign in to reply to this post

Jared Lui

Nice!

Now why didn't I think of that? Don't answer...

Thanks Jason, again.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...