Spry Effect Inside Accordion

I've come across a little hiccup when using a Spry Effect inside an Accordion. I am creating a survey page with one question per accordion tab. Some of these questions have sub-questions based on a yes or no answer.
I was able to use an onclick with a radio button to open a Spry Effect that will display more questions. The problem is that these questions are normally hidden and when the accordion renders it passes over the hidden content and ignores it when it is time for the onclick event to display them.
I was able to get it to work with one set by making the accordion open to that tab by default first (which renders the content) and then hides the sub-questions. The Spry Effect then calls a javascript function to open the fist accordion tab using the setup trigger.
But this doesn't seem to work for multiple Spry Effects on different tabs... am I missing something?
I have a demo page here (click "yes" on question 3) -- http://tv.swirelive.com/survey/demo_survey.php

Ok. I figured it out. I had to define the Spry Effects first and then the Accordion last.

Similar Messages

  • Getting squish to work on IE inside accordion which is inside a table

    Greetings all. I'm having trouble getting Squish to work
    inside an accordion, on IE only. Everything works fine in Firefox.
    Now, technically, this isn't a Spry problem; it's a problem with
    the lame HTML I'm currently stuck with. See, everything works fine
    when isolated in its own page. But when I drop the stuff into our
    existing HTML, on IE the squish stops working. What happens is that
    the div the squish is to open simply doesn't open up. it stays
    hidden.
    I've narrowed it down to this: it stops working when I put
    the accordion divs inside a table cell. Yes, I'm stuck with using
    tables for layout at this point and I can't change that. So the
    question is, Is there a way I can get the squish to work in IE with
    the accordion divs inside a table cell?
    Here's the code:
    <TABLE CLASS="bodyTable" cellpadding="0" cellspacing="0"
    width="820">
    <TR>
    <TD CLASS="middleCol" align="left" width="100%"
    id="middleCol">
    <div class="library_Accordion" id="library">
    <div
    id="library_AccordionPanel_1"class="library_AccordionPanel">
    <div
    id="library_AccordionPanelTab_1"class="library_AccordionPanelTab"
    onclick="accordionSetSelectedTabCookie('_accordion_library',0)"><h3>Search
    Library</h3></div>
    <div id="library_AccordionPanelContent_1"
    class="library_AccordionPanelContent">
    <div>
    jjjj
    </div>
    </div>
    </div>
    <div
    id="library_AccordionPanel_2"class="library_AccordionPanel">
    <div
    id="library_AccordionPanelTab_2"class="library_AccordionPanelTab"
    onclick="accordionSetSelectedTabCookie('_accordion_library',1)"><h3>Add
    Custom PDF</h3></div>
    <div id="library_AccordionPanelContent_2"
    class="library_AccordionPanelContent">
    fff
    <input type="checkbox" name="AddToLibrary" value="1"
    onclick="effect.start();resizePanel()">Add upload to Library?
    <div>
    <div id="AddToLibraryDiv" align="left"
    style="visibility:hidden;display:none">
    <p>blah blah blah</p>
    <p>blah blah blah</p>
    <p>blah blah blah</p>
    <p>blah blah blah</p>
    <p>blah blah blah</p>
    </div>
    </div>
    <script type="text/javascript">
    var effect = new Spry.Effect.Squish("AddToLibraryDiv",{from:
    "0%", to: "100%", duration: 100, toggle: true, fps: 90,
    scaleContent: false});
    function resizePanel(){
    document.getElementById('library_AccordionPanelContent_2').style.height="auto";
    document.getElementById('library_AccordionPanelContent_2').style.display="block";
    document.getElementById('library_AccordionPanelContent_2').style.visibility="visible";
    </script>
    </div>
    </div>
    </div>
    <script language="JavaScript" type="text/javascript">
    var library = new
    Spry.Widget.Accordion("library",{enableAnimation:true,steps:10,duration:200,defaultPanel: 0,useFixedPanelHeights:false});
    </script>
    </TD>
    </TR>
    </TABLE>
    Thanks to all for any advice!
    Marc E.

    now this is interesting: it appears that the problem is in
    the construction of the effect widget. if I do this:
    <input type="checkbox"
    onclick="startIt();resizePanel();">check me
    <script>
    function startIt(){
    new Spry.Effect.Squish("AddToLibraryDiv",{from: "0%", to:
    "100%", duration: 200, toggle: true, fps: 90, scaleContent:
    false}).start();
    function resizePanel(){
    document.getElementById('library_AccordionPanelContent_2').style.height="auto";
    document.getElementById('library_AccordionPanelContent_2').style.display="block";
    document.getElementById('library_AccordionPanelContent_2').style.visibility="visible";
    </script>
    Then the div will show up. now, the behavior is wrong in that
    it never disappears because of the way i'm doing it. still, this at
    least leads me to believe that showing/hiding the div inside of an
    accordion inside of a table cell is possible. So I can't use the
    constructor in the normal manner... question is, is there a way to
    do it otherwise?
    thanks all!

  • Problem combining Spry effects with image captions [was: LShub]

    I am using Spry effects combo sample 2. The thumbnails in the sample are all included within the same preview div. I need to include captions underneath the images, so I have each thumbnail and caption within a separate div. The effect still works everywhere except Explorer. In Explorer 7, the image grows behind the image in the next div.
    I read through the Spry for Ajax forum, but the Java Script used there is different. I have tried putting all the divs I want to grow inside another and giving the new div a position and z index. I have also added a z-index in the CSS of the preview div. Nothing I've tried works. Is there a fix?
    Here is a link for the page I am working on:
    http://www.nhci.com/stage/kitchens/countertops.html?tab=kitchens#
    Relevant CSS:
    .thumbs {
        clear: both;
        margin: 5px auto;   
    .thumbnails85 div {
        position: relative;
        width: 85px;
        height: 85px;
        float: left;
        margin: 6px;
        padding: 0;
        float: left;
        display: inline;
    .thumbnails85 img {
        top: 0px;
        left: 0px;
        width: 85px;
        height: 85px;
        position: absolute;
        z-index: 1;
        cursor: pointer;
        -moz-user-select: none;
        -khtml-user-select: none;
    .preview {
        padding: 3px;
        margin-bottom: 5px;
        height: 300px;
        width: auto;
        margin-right: 3px;
        position: absolute;
        float: left;
    .spacer105 {
        height:105px}
    [Subject title edited by moderator]

    I am using Spry effects combo sample 2. The thumbnails in the sample are all included within the same preview div. I need to include captions underneath the images, so I have each thumbnail and caption within a separate div. The effect still works everywhere except Explorer. In Explorer 7, the image grows behind the image in the next div.
    I read through the Spry for Ajax forum, but the Java Script used there is different. I have tried putting all the divs I want to grow inside another and giving the new div a position and z index. I have also added a z-index in the CSS of the preview div. Nothing I've tried works. Is there a fix?
    Here is a link for the page I am working on:
    http://www.nhci.com/stage/kitchens/countertops.html?tab=kitchens#
    Relevant CSS:
    .thumbs {
        clear: both;
        margin: 5px auto;   
    .thumbnails85 div {
        position: relative;
        width: 85px;
        height: 85px;
        float: left;
        margin: 6px;
        padding: 0;
        float: left;
        display: inline;
    .thumbnails85 img {
        top: 0px;
        left: 0px;
        width: 85px;
        height: 85px;
        position: absolute;
        z-index: 1;
        cursor: pointer;
        -moz-user-select: none;
        -khtml-user-select: none;
    .preview {
        padding: 3px;
        margin-bottom: 5px;
        height: 300px;
        width: auto;
        margin-right: 3px;
        position: absolute;
        float: left;
    .spacer105 {
        height:105px}
    [Subject title edited by moderator]

  • IE7 and Spry Effect

    In IE 7 when you start your div with display: none; in order
    to have the slide collapsed at start, when it expands, the text
    inside the div remains hidden, in FireFox the text displays
    properly. Any ideas?

    I just tried V1 Fusions idea and it sort of works, didn't
    have time to play with it more.
    The solution I found, though its still hack and I don't like
    it is to add a second effect to start it off closed:
    so my two effects are:
    var slideClose_effect = new Spry.Effect.Slide("slide1",
    {duration: 1, from: '0%', to: '0%', toggle: false});
    var slide_effect = new Spry.Effect.Slide("slide1", {duration:
    200, from: '0%', to: '100%', toggle: true);
    where slide_effect is triggered on a click of a link
    slideClose_effect is triggered on the page load
    and then I start off the div as visibility = hidden for the
    sliding div. Which works but now there is a blank div that
    collapses on load then works perfectly. I just wish I could start
    out with it collapsed at the get go.
    here are my two effects

  • Spry effects not recognizing classes

    When adding a spry effect to an <img> element, it will pick up on ID's but not classes.
    <style>
    img.color {color:#fffff}
    </style>
    <body>
    <img src="image.jpg" class="img.color" img />
    </body>
    In the spry effect dialogue, it will let me select the current img tag, but if i were to specify a second class
    <style>
    img.color {color:#fffff}
    img.opacity {opacity:50}
    </style>
    <body>
    <img src="image.jpg" class="img.color img.opacity" img />
    </body>
    then it wouldnt work because it can only recognize the current selection instead of the individual styles like i can do with an ID (which wont work for multiple styles as there can be only one id per element).

    It makes it very hard for us to know what you are trying to achieve without seeing some code hence I shall give you some code to work with
    <!DOCTYPE html>
    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    <body>
    <img src="header.jpg" onClick="MM_effectAppearFade(this, 1000, 100, 0, false)">
    <script src="SpryAssets/SpryEffects.js"></script>
    <script>
        function MM_effectAppearFade(targetElement, duration, from, to, toggle)
            {Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});}
    </script>
    </body>
    </html>
    Just copy and paste the above code into a new document, make sure that you do have SpryEffects.js in the SpryAssets folder and try it out.
    Gramps

  • BUG report about Spry.Effect.Highlight

    When the Spry.Effect.Highlight effect is not accomplished,
    and click the trigger link, will report the error "startColor
    undefined".

    Can you please elaborate? Which "trigger link" do you mean?
    Are you using the Spry 1.4 release?

  • Spry static gallery combined with Spry Effect Observers

    I have set up a Spry static gallery using the
    demo
    here.
    I would like to add a cross fade for the main image using the
    Spry Effect Observers shown at the bottom of
    this
    demo page.
    I like the thumbnail grow effect used in the first demo and
    like to add a cross fade for the main image when the thumbnail is
    clicked. Have someone built such an example or can someone show me
    how it is done? Typically I have 4 thumbnails/images per product
    page.

    Mr. Andersson wrote:
    > I thnik I know what's going on now...
    >
    > I tried Fireworks and it has a built in Slideshow
    creator. The setting that
    > dont use Flash uses Spry and looks like the Spry gallery
    demo. The settings
    > using Flash have cross fading images.
    >
    > From this I got the idea that Adobe maybe dont want us
    to cross fade with
    > Spry. They want to push Flash instead. It could explain
    the total silence from
    > Adobe in various threads where this question is asked.
    This is a user to user forum, Adobe will never reply to you.
    Also, Spry is still a pre-release framework, its nowhere near
    finished.
    Its the kind of framework where you take whats available and
    make
    something out of it, its very flexible if you know
    javascript.
    I am learning javascript just to understand the little bits
    that I am
    experimenting with, I think its the only way forward if you
    intend to do
    something outside the box.
    Dooza
    Posting Guidelines
    http://www.adobe.com/support/forums/guidelines.html
    How To Ask Smart Questions
    http://www.catb.org/esr/faqs/smart-questions.html

  • Spry Effects Issue

    Hello everyone,
    I'm new to spry and know very little about ajax and java but
    I'm eager to learn. I downloaded spry frameworks and I'm looking at
    the demo effects page. I click on the fade one and it fades away
    but fades back automatically. How can I set it so it wont fade back
    until it is clicked again?
    Thanks
    -Chris

    var fadename = new Spry.Effect.Fade('idoffade',
    {toggle:true});

  • Spry.Effect.GrowShrink crazy behaviour

    Hi, I was wondering if someone could help me figure out why
    when I pass the mouse over the thumbnails in my photo gallery, they
    act all jumpy. I used the same effect as in the Spry demo photo
    gallery yet they behave differently. My gallery is located here
    http://www.fotosite.ca/temp/index.htm
    my grow function looks like this (and shrink is similar)
    function GrowThumbnail(img, from, to){
    img.style.zIndex = 150;
    img.style.borderStyle = 'solid';
    img.style.borderWidth = '3px';
    img.style.borderColor = '#ffff00';
    Spry.Effect.GrowShrink(img, {duration: 500, from: from, to:
    to ,toggle:false });
    Thanks in advance for any help,

    Hi,
    I see 2 problems:
    1. The Grow/Shrink effect do not know to consider the margin,
    border and padding so when you add these properties from the
    JavaScript you'll have the weird behavior of images moving down and
    right before animation start and then up and left when the mouse
    leave.
    We automatically include the 1px border in the thumbnail view
    and we only change its color. You remove 2px from the border while
    the mouse is not over the element and when you add them the effect
    is really visible and disturbing. If you consider in keeping a such
    big value for the border then you should keep it when the images
    are not focused.
    2. While you move the mouse over the thumbnails fast some of
    the images will remain open. This is a bug that also reproduce in
    our photo gallery too and I will look to fix it while the new Spry
    will be released. The issue is basically generated by the fact you
    are not using the toggle option while running the effect.
    Cristian

  • Spry Effects

    I am using the Grow/Shrink behavior from Spry Effects in
    Dreamweaver. I am trying to grow an image from 20% to 100% but the
    image appears in the browser at a 100% then when I click on it it
    then appears at 100% and grows to 100%. Is it possible to get the
    image to appear at 20% on the page and only grow when I click on
    the image.

    gregmccarthy wrote:
    > Thanks, that works beautifully. Kinda thought that was
    what was needed but was not sure exactly how to do it - it is a
    shame that how to books that you pay good money for don't explain
    that.
    As somebody who writes books, I can tell you why. My
    "Essential Guide to
    DW CS3" devotes about 250 pages to Spry, almost certainly
    than any other
    book on the market; but I don't include that technique. If I
    tried to do
    so, my 750 page book would probably be 7,500 pages long, and
    would be
    published a couple of years late.
    One of the great things about web design is that you can do a
    lot of
    amazing things by experimenting. But you need to have a firm
    grasp of
    the basic technology to be able to do so. That's one of the
    main things
    you can learn from books. I had no idea how to create the
    effect that
    you wanted, but I did know how to apply a Spry effect. I sat
    and thought
    about the problem for about two minutes, tested my theory,
    and was
    delighted to discover that it worked. Devising new techniques
    rarely
    goes as quickly as that, but that's the challenge - and fun -
    part of it.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Spry Effects Question

    Is there a way to use a spry effect to have a div (or image)
    fade away and have it show the page underneath. For example, I have
    a page where I want there to be a picture when you open the page. I
    then want the picture to fade out automatically, and have my web
    page (with navigation, etc) underneath of it show up. It seems that
    when using spry effects however, the image will fade out, but it
    doesn't fade to nothing. There is something there still blocking
    the content underneath.
    Any help at all would be greatly appreciated!

    Hi,
    I've just reproduced your case and I have a solution for you.
    After the effect finishes, you should made the image
    invisible and in the same time to release the space occupied by the
    image.
    To do this, add into the effect constructor the option:
    'finish:' that receives a function as parameter. On this function
    you set for the image to become invisible after the effect finishes
    by adding display:none.
    The constructor should look like this:
    var effect = new Spry.Effect.Fade('test', {duration: 3000,
    from: 100, to: 0, finish:function(el,
    eff){el.style.display='none';}});
    The effect will be started onload.
    Diana

  • Spry MenuBar/TabbedPanels/Accordion Javascript Not Working in IE8

    As you've heard, Adobe removed the links to the Spry API files (http://blogs.adobe.com/dreamweaver/2012/08/update-on-adobe-spry-framework-availability.htm l).
    My question is: If I link to a remote file, then my spry menu bar/accordion/etc. work in IE 8 properly. If I link to a local file (same content as the remote file though!!), then my spry menu bar/etc. don’t work on IE 8.
    Because the remote files are no longer available on Adobe's API site, I had to change all my links and make it linked to SpryAssets/SpryMenuBar (for instance) on my local web server instead. HOWEVER, this doesn't work for IE8.
    Why is that? WHy is it necessary to link to a remote file? http://spry-it.appspot.com/ works for me too because it’s remote (however, the file accordion is not available it seems!). But what if they change their link again in the future or remove the link?
    Please help!
    The website is www.compex.com.sg (please have a look in IE8!!)
    Thanks a lot!

    You might want to cut your losses right now and switch to a different widget framework. 
    Personally, I never liked Spry.  I've been using jQuery for quite some time.
    If you want to get it done fast with professional results, look at Project Seven's products. They are rigorously tested to perform well in modern devices. If you need it, their customer support is excellent.
    http://www.projectseven.com/
    Nancy O.

  • Spry Effects doesnt work with position:absolute CSS

    HI guys,
    I have a text with position: absolute; left: 20px; top: 10px;
    to it and using Spry's Fade Effect, it just shows it without any
    fade animation, any ideas why?
    quote:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    <script src="assets/SpryAssets/SpryTabbedPanels.js"
    type="text/javascript"></script>
    <script src="assets/SpryAssets/SpryEffects.js"
    type="text/javascript"></script>
    <script src="assets/SpryAssets/xpath.js"
    type="text/javascript"></script>
    <script src="assets/SpryAssets/SpryData.js"
    type="text/javascript"></script>
    <link href="assets/SpryAssets/SpryTabbedPanels.css"
    rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .TabbedPanelsContent {
    background-color: #006699;
    .cool {
    background-color:#993366;
    position:absolute;
    left: 20px;
    top: 10px;
    -->
    </style>
    <script type="text/javascript">
    <!--
    function TabbedPanelsCycler(tp)
    this.tp = tp;
    this.timerID = 0;
    this.interval = 5000; // Milliseconds
    TabbedPanelsCycler.prototype.start = function()
    this.stop();
    var self = this;
    this.timerID = setTimeout(function() { self.next(); },
    this.interval);
    TabbedPanelsCycler.prototype.stop = function()
    if (this.timerID)
    clearTimeout(this.timerID);
    this.timerID = 0;
    TabbedPanelsCycler.prototype.next = function()
    var tp = this.tp;
    Spry.Effect.DoFade('Content' + (tp.getCurrentTabIndex()+1) %
    tp.getTabbedPanelCount(), {duration: 1000, from: 100, to: 0,
    toggle: false, finish: function(){
    var el = document.getElementById('Content' +
    ((tp.getCurrentTabIndex() + 1) % tp.getTabbedPanelCount()));
    tp.showPanel((tp.getCurrentTabIndex()+1) %
    tp.getTabbedPanelCount()); // 1, 2, 3, 4, 0 ... loop
    Spry.Effect.DoFade('Content' + (tp.getCurrentTabIndex() + 1)
    % tp.getTabbedPanelCount(), {duration: 1000, from: 0, to: 100,
    toggle: false});
    if (this.timerID)
    this.start();
    TabbedPanelsCycler.prototype.previous = function()
    var tp = this.tp;
    var curIndex = tp.getCurrentTabIndex();
    tp.showPanel(((curIndex < 1) ? tp.getTabbedPanelCount() :
    curIndex) - 1);
    if (this.timerID)
    this.start();
    function MM_effectAppearFade(targetElement, duration, from,
    to, toggle)
    Spry.Effect.DoFade(targetElement, {duration: duration, from:
    from, to: to, toggle: toggle});
    var dsFeaturebox1 = new
    Spry.Data.XMLDataSet("assets/xml/featurebox_data.xml",
    "featurebox/feature1");
    //-->
    </script>
    </head>
    <body onload="cycler.start();">
    <div id="TabbedPanels1" class="TabbedPanels">
    <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab"
    onclick="MM_effectAppearFade('Content1', 1000, 0, 100, false)"
    tabindex="0">Tab 1</li>
    <li class="TabbedPanelsTab"
    onclick="MM_effectAppearFade('Content0', 1000, 0, 100, false)"
    tabindex="0">Tab 2</li>
    </ul>
    <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent" id="Content1">
    <div>Normal text here</div>
    </div>
    <div class="TabbedPanelsContent" id="Content0"
    spry:detailregion="dsFeaturebox1">
    <div class="cool">{XML text here}</div>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    <!--
    var tp1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var cycler = new TabbedPanelsCycler(tp1);
    //-->
    </script>
    </body>
    </html>
    Thanks,
    J

    Hi guys,
    I just would like to know why adding position: absolute on my
    css would stop the Spry Effects from doing its job? Thanks!

  • Spry:if inside a tr element

    Hello,
    I would like to add a "selected" class to a html table row
    element if the curRowID == {dsRowID} so I tried the following
    <tr spry:if="searchBar.searchResults.listDataSet.curRowID
    == {ds_RowID}" class="selected" spry:select="selected"
    spry:repeat="searchBar.searchResults.pagedView"
    onclick='searchBar.searchResults.itemClick("{x}","{y}","{id}");'>
    <td>{fileid}</td>
    <td>{title}</td>
    </tr>
    <tr spry:if="searchBar.searchResults.listDataSet.curRowID
    != {ds_RowID}" spry:select="selected" class="listRow"
    spry:repeat="searchBar.searchResults.pagedView"
    onclick='searchBar.searchResults.itemClick("{x}","{y}","{id}");'>
    <td>{fileid}</td>
    <td>{title}</td>
    </tr>
    The above doesn't work for me as all the table rows are given
    the "selected" class. It looks as if the spry:if is only executed
    once.
    I can put the spry:if inside the table cells and the code
    below works i.e only one table row is "selected" with that row's td
    elements having a class of "selected" -
    <tr spry:select="selected" class="listRow"
    spry:repeat="searchBar.searchResults.pagedView"
    onclick='searchBar.searchResults.itemClick("{x}","{y}","{id}");'>
    <td spry:if="searchBar.searchResults.listDataSet.curRowID
    == {ds_RowID}" class="selected">{id}</td>
    <td spry:if="searchBar.searchResults.listDataSet.curRowID
    != {ds_RowID}">{id}</td>
    <td spry:if="searchBar.searchResults.listDataSet.curRowID
    == {ds_RowID}" class="selected">{title}</td>
    <td spry:if="searchBar.searchResults.listDataSet.curRowID
    != {ds_RowID}">{title}</td>
    </tr>
    Is it possible to use spry:if inside a tr like I want to ,
    rather than each cell?
    Thanks.

    Just to clarify here, if you had the following:
    <tr spry:if="a == b" spry:repeat="ds1" spry:test="a ==
    c">
    It gets interpreted like this:
    If a==b then spry:repeat over all the rows in the data set
    and only write out the <tr> if a==c.
    If a!=b then don't execute the spry:repeat, so nothing gets
    written out.
    In other words, spry:if always gets evaluated first and then
    spry:repeat. If you need to conditionally write out something
    during the repeat, then place your expression in a spry:test, which
    gets evaluated for every iteration of the repeat.
    --== Kin ==--

  • Spry content inside HTMLPanel

    I would like tot know if it is possible to update a spry
    region inside an HTMLPanel. When I load an HTML part with the
    Spry.Widget.HTMLPanel. the Spry region data inside it won't update.
    After onPostLoad is fired when loading the new part in the
    HTMLPanel I call the loadData and force the redraw of the region
    and call the region method updateRegion() (as in the Adobe API
    example) or the rgn.updateContent();
    but nothings helps.

    Did u take a look at this sample?
    http://labs.adobe.com/technologies/spry/samples/utils/update_content.html
    (it doesnt use html panels)

Maybe you are looking for