Spry Accordian - Javascript Variable - Replace simple ASP

Hey Gang,
I'm not familiar with Javasscript Syntax as much as I'd like
to be.
But I need to quickly replace this simple VBScript for
grabbing a querysting
and using it in the page
Basically I'm using the Spry Accordian and setting the
default panel based
on a querystring variable.
There may be a far better way, but this is a quick example.
What I need is a Javascript solution.
Thanks
-Dave
<%
Select case Request.Querystring("p")
Case "0"
strPanel = "0"
Case "1"
strPanel = "1"
End select
%>
<script type="text/javascript">
<!--
var Accordion1 = new Spry.Widget.Accordion("Accordion1", {
defaultPanel: <%=
strPanel %> });
//-->
</script>

Hi Gramps!
Appreciate your advice and reference to Backyard Furniture. I've been working on it and thought I was getting close...but the revised coding just created havoc on my site.
Could you please have a look at  http://www.trafficnetwork.ecanvas.com.sg/TMA.html and advice?
Cheers!

Similar Messages

  • Using javascript variable in spry if statement

    is it possible to put a javascript variable in to the spry if
    statement to test?
    like <div spry:if="javascriptvar == {ds_RowNumber}"....
    thanks.

    Hi rogerfreak,
    When the region processes a spry:if, it simply takes the
    value of the spry:if attribute, replaces all of the data references
    in it with real values from the data set and then evals the result
    (executes the string).
    So you can do something like:
    <script>
    var ds1 = new Spry.Data.XMLDataSet("foo.xml", "/foo/bar");
    var gMode = 5;
    function GetMode()
    return gMode;
    </script>
    <div spry:region="ds1">
    <ul spry:if="gMode == 5">
    <li spry:repeat="ds1">{name}</li>
    </ul>
    <div spry:if="gMode == 12" spry:repeatchildren="ds1">
    {name}
    </div>
    </div>
    In the example above the list markup will be written out if
    gMode is 5, but if it is 12, it will write out the div markup.
    You can also call functions:
    <div spry:region="ds1">
    <ul spry:if="GetMode() == 5">
    <li spry:repeat="ds1">{name}</li>
    </ul>
    <div spry:if="GetMode()== 12"
    spry:repeatchildren="ds1">
    {name}
    </div>
    </div>
    --== Kin ==--

  • Spry Accordian Tabs Question

    Hi
    I'm trying to create a spry accordian menu for a navbar and am having some trouble.
    This is the first time I've tried it so I would appreciate any help.
    The Client would like the tabs to be:
    Home
    Students
       High School Students
       College Students
    Professionals
    Parents/Educators
    Seminars
    Bio
    Q  & A Blog
    Testimonials
    So all they would like High School Students and College Students to be child tabs underneath the parent tabs and all other tabs to be parent tabs.
    They asked for a spry accordian.
    They want the nav bar to be on the left.
    Here is the link to the website online:
    http://www.elynncohen.com/index2spry2.html#
    and here are my questions:
    1. The spry accordian has a box around it on mouse down but I can't figure out how to get rid of it. I've checked all the CSS rules for the spry accordian and none of them seem to have rules around them.
    2. All the tabs have a content area underneath them and we only want content areas underneath the student tab. You see how it goes when you click on any of the tabs, you get a little thing that says content 1, 2 etc. I tried deleting them in the code and the page goes completely crazy when I do and the nav bar areas stretch all the way across the page.
    3. I can't figure out how to get the child tabs (which would be the tabs under students which say high school and college) to have two tabs. You will see that it does have the high school tab there now. When I try cutting and pasting the code to try to get two tabs, it does not work. The spry accordian framework only creates one content area under each tab.
    4. I'd like the child tabs to have a narrower height than the parent tabs, and be indented so that they will clearly be set off and different than the parent tabs.
    Any help would be much appreciated!
    Thanks!!!
    Here is my code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Your Career Direction Career and College Counseling</title>
    <meta name="Keywords" content="career counseling, college counseling, job search, career choice, college options, career options, work, jobs, new opportunities, career change, new career, new job" />
    <meta name="Description" content="Your Career Direction :: Career and College Counseling" "Considering your college choices & career options" "Preparing for the world of work after college" "Seeking a new position to further your career"
    "In-transition and considering new opportunities"
    "Seeking to make a significant and meaningful career change"  />
    <meta name="Publisher" content="Your Career Direction, LLC" />
    <meta name="Copyright" content="Copyright 2012, Your Career Direction, LLC. All rights reserved." />
    <meta name="Author" content="Lisa Mark" />
    <meta name="Language" content="en-US" />
    <meta name="distribution" content="global" />
    <meta name="revisit-after" content="10 days" />
    <meta name="Robots" content="All" />
    <link rel="Index" href="index.html" />
    <link rel="Site Map" href="sitemap.html" />
    <script type="text/javascript" src="//use.typekit.net/ifb2bte.js"></script>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
    <style type="text/css">
    <!--
    body {
        margin: 0;
        padding: 0;
        color: #000;
        font-size: 100%;
        line-height: 1.4;
        background-image: url(images/background.gif);
        background-repeat: repeat;
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
        padding: 0;
        margin: 0;
    h1, h2, h3, h4, h5, h6, p {
        margin-top: 0;     /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
        padding-right: 15px;
        padding-left: 15px;
    .container .sidebar1 h3 {
        padding-left: 0px;
        color: #C60651;
        font-size: x-large;
    h1 strong {
        color: #C60651;
        font-size: 90%;
        font-family: "Binary ITC Bold";
    h1 strong em {
    a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
        border: none;
    /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
    a:link {
        color:#414958;
        text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
    a:visited {
        color: #4E5869;
        text-decoration: underline;
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
        text-decoration: none;
    /* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
    .container {
        width: 80%;
        max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
        min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
        background: #FFF; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
        margin-top: 0;
        margin-bottom: 0;
        margin-right: auto;
        margin-left: auto;
        border-right-width: thick;
        border-left-width: thick;
        border-right-style: solid;
        border-left-style: solid;
        border-right-color: #C60651;
        border-left-color: #C60651;
    /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
    .header {
        padding-top: 40px;
    #Quote {
        float: right;
        clear: left;
        margin-right: 1%;
    /* ~~ These are the columns for the layout. ~~
    1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
    2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.
    3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.
    4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.
    .sidebar1 {
        float: left;
        width: 15%;
        padding-bottom: 10px;
        margin-top: 40px;
        margin-left: 25px;
        background-color: #FFF;
        font-family: museo-sans;
    arial;
        max-width: 200px;
        min-width: 180px;
    .content {
        float: left;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 10;
        font-family: museo-sans;
    arial;
        margin-top: 40px;
        padding-right: 10px;
        width: 50px;
        font-size: large;
    .container .content p {
        padding-top: 0px;
    .sidebar2 {
        float: left;
        width: 20%;
        background-color: #D3CCB2;
        margin-top: 40px;
        padding-top: 10px;
        border-top-color: #FFF;
        border-right-color: #FFF;
        border-bottom-color: #FFF;
        border-left-color: #FFF;
        border-right-width: 5px;
        font-family: museo-sans;
    arial;
        font-size: 90%;
        right: 12%;
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol {
        padding-top: 0px;
        padding-right: 25px;
        padding-bottom: 15px;
        padding-left: 40px;
        font-family: museo-sans; arial;
        font-size: 100%;
        color: #666;
    .container .content p {
        font-family: museo-sans;
    arial;
        padding-top: 0px;
        padding-left: 17px;
        padding-bottom: 0px;
    #Quote {
        float: right;
        clear: both;
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
        list-style: none; /* this creates the space between the navigation on the content below */
        font-family:museo-sans; arial;
        line-height: 250%;
    .nav {
        font-family: museo-sans;
    arial;
        padding-left: 0px;
    ul.nav li {
        font-family: museo-sans; arial;
        padding-bottom: 10px;
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
        display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
        text-decoration: none;
        color: #333333;
        background-color: #FFF;
        font-family: museo-sans; arial;
        padding-top: 5px;
        padding-right: 5px;
        padding-bottom: 10px;
        padding-left: 15px;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
        color: #C60651;
        font-family:museo-sans; arial;
        background-color: #FFF;
        background-image: url(images/navbar2.gif);
        padding-bottom: 10px;
    .content img {
    /* ~~The footer ~~ */
    .footer {
        position: relative;/* this gives IE6 hasLayout to properly clear */
        clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
        padding-top: 0px;
        padding-right: 0;
        padding-bottom: 10px;
    /* ~~miscellaneous float/clear classes~~ */
    .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
        float: right;
        margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
        float: left;
        margin-right: 8px;
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
        clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    .container .content {
        width: 50%;
        font-size: large;
        font-family: museo-sans; arial;
    #footer {    width: 100%;
        background-color: #FFF;
    .container .sidebar2 h4 img {
        padding-left: 20px;
        padding-top: 0px;
    .sidebar2 p img {
        border: medium solid #C60651;
    #Insert_logo2 {
        border-top-width: 4px;
        border-right-width: 4px;
        border-bottom-width: 4px;
        border-left-width: 4px;
        border-top-color: #fff;
        border-right-color: #fff;
        border-bottom-color: #fff;
        border-left-color: #fff;
    .container .content p .content strong {
        font-family: museo-sans; arial;
    .container .content .content {
        font-family: museo-sans; arial;
    .container .content ul li strong {
        font-family: museo-sans;
    arial;
        font-size: 95%;
        line-height: 150%;
        list-style-type: disc;
    .container .content ul {
    test {
        font-family: "Binary ITC Bold";
    .container .sidebar2 p img {
        margin-right: auto;
        margin-left: auto;
        border-top-width: medium;
        border-right-width: medium;
        border-bottom-width: medium;
        border-left-width: medium;
        border-top-color: #C60651;
        border-right-color: #C60651;
        border-bottom-color: #C60651;
        border-left-color: #C60651;
    li strong {
        line-height: 130%;
        list-style-type: circle;
        color: #978980;
    .container .content ul {
    .container .sidebar1 .nav {
        margin-top: 10px;
        margin-bottom: 10px;
    .sidebar1 .nav li {
        padding-bottom: 10%;
    .nav li a {
        background-image: url(images/navbar2.gif);
        background-repeat: no-repeat;
        background-position: right center;
        left: auto;
        right: auto;
        clip: rect(auto,auto,auto,auto);
    .container .sidebar1 .nav li a {
    .container .sidebar1 h6 {
        padding: 0px;
        color: #000000;
    #footer h3 strong {
        font-size: 60%;
        color: #978980;
    .container .content p {
        padding-right: 0%;
        padding-left: 0%;
        font-size: 85%;
    .container .sidebar2 p {
        padding-right: 8%;
        padding-left: 8%;
        padding-top: 5px;
    #Insert_logo2 #Insert_logo2 {
        padding-left: 15px;
    .container .content ul {
        color: #C60651;
    h6 {
        color: #978980;
        font-family: museo-sans;
    arial;
        font-size: 82%;
        padding-left: 20%;
        text-align: left;
        text-indent: 8px;
    .nav li a {
        padding-bottom: 10px;
    h8 {
        font-family: museo-sans; arial;
        font-size: 100%;
    h4 {
        font-family: museo-sans;
    arial;
        font-size: 100%;
        color: #C60651;
        padding-left: 17px;
        padding-top: 5px;
        padding-bottom: 0px;
    .container .content p {
        padding-left: 17px;
        padding-right: 30px;
    .sidebar1 h8 strong {
        font-size: 80%;
        font-family:museo-sans; arial;
    .container .sidebar1 h7 {
        font-size: 40%;
        color: #978980;
    h7 {
        font-family: museo-sans; arial;
        font-size: 15%;
    .container .sidebar1 h8 {
        font-family: museo-sans; arial;
    .sidebar2 p img {
            max-width: 100%;
    .container .content img {
        padding-left: 3%;
    img {
        position: static;
        text-align: left;
    body,td,th {
        font-family: museo-sans; arial;
    h5 {
        font-size: 150%;
        color: #C60651;
        padding-left: 0px;
        font-family:museo-sans; arial;
    .container .content p {
        padding-left: 17px;
        padding-right: 30px;
        font-size: 87%;
    .container .sidebar2 p {
        font-size: 90%;
    .container .sidebar1 .nav li {
        font-family: museo-sans;
    arial;
    .container .sidebar1 .nav li a {
        padding-left: 0px;
        margin-bottom: 0px;
        height: 30px;
    li a {
        padding-left: 2px;
    -->
    </style><!--[if lte IE 7]>
    <style>
    .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
    ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
    </style>
    <![endif]-->
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
    </head>
    <body><script type="text/javascript">
    function pageWidth() {
    return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
    function pageHeight() {
    return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
    </script>
    <div class="container">
      <div class="header"><!-- end .header -->
        <p class="clearfloat"><a href="#index.html" id="Insert_logo2"><img src="images/YCD-logo-tag-RGB-web-SM.gif" alt="Your Career Direction Logo" name="Insert_logo" width="50%" id="Insert_logo2" style="background: #FFF
        ; display:block;" /></a></p>
        <div id="Quote"><img src="images/quote.gif" alt="Choose a job you love" width="355" height="81"></div>
        <p class="clearfloat"> </p>
    </div>
      <div class="sidebar1">
        <ul class="nav">
          <li>
            <div id="Accordion1" class="Accordion" tabindex="0">
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Home</a></div>
                <div class="AccordionPanelContent">Content 1</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Students</a></div>
                <div class="AccordionPanelContent"><a href="#">High School</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Professional</a></div>
                <div class="AccordionPanelContent">Content 3</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Parent/Educator</a></div>
                <div class="AccordionPanelContent">Content 4</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Seminars</a></div>
                <div class="AccordionPanelContent">Content 5</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Bio</a></div>
                <div class="AccordionPanelContent">Content 6</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Q &amp; A Blog</a></div>
                <div class="AccordionPanelContent">Content 7</div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Testimonials</a></div>
                <div class="AccordionPanelContent">Content 8</div>
              </div>
            </div>
          </li>
        </ul>
      </div>
      <div class="content">
    <p>Given today's competitive job market, global economy, and changed corporate culture,
    we can no longer depend upon others to ensure our professional futures. Choosing or
    changing your career direction requires self-reflection, career education and an action plan.</p>
    <img src="images/Whether-you-are-.gif" alt="Whether you are considering your college choices and career options" width="197" height="31" align="left">
    <ul>
          <br><br><li><strong>Considering your college choices &amp; career options</strong></li>
          <li><strong>Preparing for the world of work after college</strong></li>
          <li><strong>Seeking a new position to further your career</strong></li>
          <li><strong>In-transition and considering new opportunities</strong></li>
          <li><strong>Seeking to make a significant and meaningful career</strong> <strong>change</strong></li>
        </ul>
    <img src="images/Onethingisforsureraster.gif" width="352" height="49" alt="One thing is for sure, we all want to direct our own careers, our own lives!">
    <br><p> Building a successful and rewarding career requires linking your interests, education and experience with employment trends, growth industries, and career choices. It takes making smart decisions about your college major, vocational training and continuing education options. With enthusiasm, persistence and top notch job search skills, you can succeed in finding a path to career that is right for you.</p>
    <p> We are your advocate. We listen, assess, strategize, inspire, counsel, and network on your behalf. With a personalized, holistic approach, we'll work with you to help you create an action plan; a path designed to get you to where you want to go and become what you want to be.</p>
    <img src="images/yourcareerourpassionraster.gif" width="441" height="20" alt="At Your Career Direction, YOUR career is our passion!"> </div>
      <div class="sidebar2">
        <p><img src="images/Counselingastudent.gif" width="100%" alt="Lisa Mark counseling a student"></p>
        <p>Our mission is to help you explore, choose and create your direction for an exciting and rewarding career path.</p>
         <p>We incorporate our experience with today's job market and career counseling expertise with your passions and interests. We'll introduce you to new career ideas, target companies and generate job and internship opportunities for you.</p>
         <p>We provide step by step guidance to ensure your success during the college application, job interview
    and decision making process.
    </p>
    </div>
      <div class="footer">
        <div id="footer">
          <h6 align="left"> Your Career Direction, LLC •  96 Harvard Avenue, Maplewood, N.J. 07040 • (973) 996-0207 • [email protected]</h6>
        </div>
        <p> </p>
      <!-- end .footer --></div>
    <!-- end .container --></div>
    <script type="text/javascript">
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    </script>
    </body>
    </html>

    1. The spry accordian has a box around it on mouse down but I can't figure out how to get rid of it. I've checked all the CSS rules for the spry accordian and none of them seem to have rules around them.
    2. All the tabs have a content area underneath them and we only want content areas underneath the student tab. You see how it goes when you click on any of the tabs, you get a little thing that says content 1, 2 etc. I tried deleting them in the code and the page goes completely crazy when I do and the nav bar areas stretch all the way across the page.
    3. I can't figure out how to get the child tabs (which would be the tabs under students which say high school and college) to have two tabs. You will see that it does have the high school tab there now. When I try cutting and pasting the code to try to get two tabs, it does not work. The spry accordian framework only creates one content area under each tab.
    4. I'd like the child tabs to have a narrower height than the parent tabs, and be indented so that they will clearly be set off and different than the parent tabs.
    1. Line 454
    <div id="Accordion1" class="Accordion" tabindex="0" style="outline: none;">
    2 & 3. Change your code from Line 455 - 491:
    <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Home</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Students</a></div>
                <div class="AccordionPanelContent"><a href="#">High School</a><br/><a href="#" style="margin-top: -30px;">College</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Professional</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Parent/Educator</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Seminars</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Bio</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Q &amp; A Blog</a></div>
              </div>
              <div class="AccordionPanel">
                <div class="AccordionPanelTab"><a href="#">Testimonials</a></div>
              </div>
            </div>
          </li>
        </ul>
      </div>
    4. Append your HTML for child tabs like this:
    <div class="AccordionPanelContent" id="submenu"><a href="#">High School</a></div>
    Create a new #submenu css rule in your CSS document and set styling the way you want it.

  • Using Spry Data Set Variable in Recordset

    I have a page that contains a spry data set and a recordset. The recordset uses one of the variables from the spry data set to filter its results. how do I apply the spry data set variable to the recordset?

    I believe passing this the variable through the URL requires you to update the page, right?
    Yes
    Is there anyway to grab the spry data set variable direct and apply it to your recordset filter?
    The SpryDataSet variable can only be used on the clientside (JavaScript) so you will have to get your recordset using JS.
    A page refresh can be set in motion if you add {useCache: false, loadInterval: 500} to your dataset to then set an observer to your dataset to invoke the page refreash function.
    Gramps

  • Javascript variable names in strings

    This should be easy, but i can't find any info on how to do
    it!
    It's easy to put the contents of a variable into a string but
    how does one place the name of a Javascript variable into a
    string??
    The only solution i have found is to store the name
    separately as a string, but this isn't very neat.

    OK, simple statement first:
    Integer does not equal string.
    You also seem to be tossing around "runtime" and "static" somewhat liberally. Once you wire an integer (be it a control or block diagram constant) to the case structure's selector, the cases can only take on integer values. This is by design. If you wire a string, the case items take on string values. If you wire an enum, the case items take on the enumeration values. Once you've defined a case structure's cases you can't change them at "runtime". This, by definition, is different code.
    That said, it seems to me that you're looking for an enum.

  • Spry Accordian in navigation

    Hi,
    I am new to the spry and I am using DW CS 3 from a Mac
    (Leopard). It's a cool effect that help designers me who are new to
    scripting or no background at all. I am trying to use the Spry
    Accordian in my navigation as a vertical menu with sub categories
    inside each panel content. My client want to use a specific font so
    I cannot use regular fonts inside the accordian. So I am using jpeg
    button images as roll over, both inside the panel and panel
    contents. I have figured out things like variable heights in
    panels, setting default panels etc. and it works well.
    However the issue is my client says that on IE on a PC the
    whole thing is shaky when navigating, as it jumps around in
    transition which I noticed even on my Safari. After searching
    through your help forums I saw a similar post and the
    recommendation was update the Spry to 1.6. I did that I it seems to
    have helped it localy on my computer in Safari. I haven't changed
    it on the test site as I wanted an expert from here to look at it
    and let me know if I am on the right track or if I need to do
    anything else.
    You can see what my client is referring to when you are in
    OUR PEOPLE category (select a bio) and then try to select OUR
    SOLUTIONS (again select a sub category) and the whole accordian
    jumps and shifts before settling down the way I want it. Any help
    you can give me is much appreciated.. and please note that I am
    basically a designer and not a programmer, so my knowledge on
    scripts are limited...
    Here's the URL to the test site:
    http://www.canlanka.com/ignition/company.html

    Thanks for your reply.....
    The reason I am using images are because the client wants the
    corporate font (Antique Olive) at least used on the buttons and
    headline. This prevents me using the CSS styles and I am not
    proficient enough to find a way to embed this particular font. I
    can change the jpegs into giffs as you suggested if that helps. I
    am also wondering if the staggered loading is anything to do with
    the overflow setting on the panels in the SpryAccordian.css file? I
    had to change it to visible in order to go in and change the image
    as they are selected, after which I have kept the setting as
    AUTO... may be is should be HIDDEN... or it may got n0thing to do
    with the issue... but I am running out of options here....

  • External javascript variable problem

    QUESTION: Why would an external javascript variable be undefined if I set it equal to all the links in a page?
    BACKGROUND: I have a simple image swap function that works when the script is all in the html. But when I tried taking the script to an external javascript file, when I gather all the anchors on the page. The variable that is supposed to refer to the anchors is considered undefined in the middle of the script.
    EXAMPLE: I have place an example online. You may check it out. Please.
    Thanks!
    Message was edited by: UteFanJason

    So I checked out that link, and some information on scope. I got the function to work. Check it out.
    I did some more reading, and it turns out that the onload event is when the entire DOM has finished loading. (That is according to a book put out a couple of years ago so it could be different now).
    This is what I changed the the code to:
    function prepare_thumbs() {
        var main_img = document.getElementById('main_img');
        links = document.getElementsByTagName('a');
        for (x=0; x<links.length; x++) {
            links[x].onclick = function() {
                main_img.setAttribute('src', this.getAttribute('id'));
                return false;
    window.onload = prepare_thumbs;
    Again, thanks for the help!

  • Spry Accordian Widget

    OK, I'm thinking this may be impossible to explain, but here
    goes. I have a simple table. I install a Spry Accordian widget to
    one of the table's columns, and the whole table (the who page
    actually) explodes laterally, breaking apart pictures, and
    segmenting what was just a simple table. What gives here? Any help
    is MOST appreciated!!

    add the option defaultPanel:-1 to the constructor
    var bla = new
    Spry.Widget.Accordion('id',{defaultPanel:-1});

  • Load Content into a javascript Variable

    Hello guys. I very new to spry and I need some help.
    How can I load content (text) from a html page(actually I
    want to get a result from a dynamic php script) into a javascript
    variable?
    I saw the fragments example in wich spry loads some html
    fragment into a div, etc... but I need the result text to be stored
    in a variable so I can test the result before update the div.
    Thanks in advance...

    I think this function updateContent shoud have a parameter to
    tell if we want the content to be loaded inside a container or a
    variable. It would be very helpful to integrate php/mysql
    validation scripts to forms. I wanted to test if a username was
    already in the database when the user choose the username in the
    form, so I made a custom function and aplied it to the textbox
    validation widget. Its working great, but it would be better if I
    didnt have to create invisible divs to receive the response from
    the php script I made.
    Thanks anyway. Spry is a great product.

  • Spry Accordian Invalid XHTML

    Hi:
    I created a spry accordian from DW CS3. Insert/Spry/Spry Accordian, but when I run through the W3C validation site I get the following error report:
    Line 182, Column 49:         Attribute "tabindex" exists, but can not be used for this element.
    <div id="Accordion1" class="Accordion" tabindex="0">

    You have used the attribute named above in your document, but the       document type you are using does not support that attribute for this       element. This error is often caused by incorrect use of the "Strict"       document type with a document that uses frames (e.g. you must use       the "Transitional" document type to get the "target" attribute), or       by using vendor proprietary extensions such as "marginheight" (this       is usually fixed by using CSS to achieve the desired effect instead).
    This error may also result if the element itself is not supported in       the document type you are using, as an undefined element will have no       supported attributes; in this case, see the element-undefined error       message for further information.
    How to fix: check the spelling and case of the element and attribute,        (Remember XHTML is all lower-case) and/or        check that they are both allowed in the chosen document type, and/or       use CSS instead of this attribute. If you received this error when using the        <embed> element to incorporate flash media in a Web page, see the        FAQ item on valid flash.
    Here's the code straight from DW. Any help much appreciated TIA!
    <!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="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 1</div>
        <div class="AccordionPanelContent">Content 1</div>
      </div>
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 2</div>
        <div class="AccordionPanelContent">Content 2</div>
      </div>
    </div>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    //-->
    </script>
    </body>
    </html>

    Your best bet regarding that particular "error" (tabindex exists but cannot be used for this element) is to remove the tabindex attribute and value from your markup.
    Unless you have a good reason to have it there, it is basically nonfunctioning. There are probably other ways to set a tab order, but typically, accessibility indicates that you should set up your page (code) in the order that you would like it 'read' by screen readers. Then it will naturally tab from form element to form element in order.
    Beth

  • Problems with spry accordian widget in CS5

    I am updating a client's website and am having problems with the spry accordian widget. I read that it has been replaced with jQuery in the latest version and am told I can modify my existing spry widgets but cannot add new ones. In trying to modify the existing widget I get error alerts. I guess adding a new accordian tab is not considered a modification of the existing widget. I only have CS5 version of DW. What to do?  Thanks in advance for your help.

    Hi Patricia,
    you with your CS5 can continue to use the spry accordian widget BUT it's inopportune. I quote from different contributions of the forum: "Spry has been deprecated and is no longer officially supported by Adobe", “Adobe abandoned Spry late last year after CS6 came out. Future products will probably not contain any Spry so learning to use jQuery is a valuable skill to have for the future.” So I/we recommend you to switch to a jQuery library for your further requirements."
    You may have a look here: http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm, where you will find a wide range of different menus.
    On the other hand - to become closer with your problem - you could send us the link to your website in question.
    Hans-Günter

  • Why does my spry accordian look good in live view and switch back to default in safari

    i am new to dreamweaver and have started my first page-
    step one inserted a picture as a background
    step 2 inserted a spry accordian and have spent hours trying to configure it - my dreamweaver wont allow me to type any information in the design view so i worked out how to get around that in the code - so i put in the labels - changed the font
    then i got rid of any color by adding the hex value #0.0 (transparent) in the spryaccordian.css page  - which has worked really well in the live view ( and works in opera) but when i check it in safari it has reverted back to the default settings - it hasnt even kept the font settings
    i would also like to put quite a lot of information in the content panels (pictures, subscriber list, links ect, essentially whole pages) is this possible
    hoping someone can help me
    kind regards
    mandy evans

    Have a look at the following, just copy and paste into a new document in code view.
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
    <style>
    html {
        background-color: #FF9;
    body {
        width: 960px;
        margin: auto;
    .Accordion {
        font: 14px "Comic Sans MS", cursive;
        color: #090;
    .AccordionPanelTab,
    .AccordionPanelOpen .AccordionPanelTab,
    .AccordionFocused .AccordionPanelTab,
    .AccordionFocused .AccordionPanelOpen .AccordionPanelTab {
        background-color: transparent;
    </style>
    </head>
    <body>
    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 1</div>
        <div class="AccordionPanelContent">Content 1</div>
      </div>
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 2</div>
        <div class="AccordionPanelContent">Content 2</div>
      </div>
    </div>
    <script type="text/javascript">
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    </script>
    </body>
    </html>
    Gramps

  • Assigning a java value(filepath) to a javascript variable

    I have a JSP where I have a java variable(obtained from session) which is nothing but a filepath(say C:\superb.xpdl). When I try to use the variable in javascript using var scriptVar = "<%= sessionVar %>";, the sessionVar value i.e. the filepath is getting modified (like C:superb.xpdl). Slashes are interpredted in a different way(\t for tab, \n for new line etc.,) How to get the filepath with no modifications while assigning to javascript variable? will encoding(using escape()) and decoding help?

    unfortunately you need to double up the slashes
    maybe this will work
    scriptVar = "<%= sessionVar.replaceAll("\\", "\\\\") %>";
    or maybe it will cause a infinite recursion problem (i'm too lazy to try it)

  • How can i assign a Javascript variable to JSP variable

    Hi guys
    how i can assign a javascript variable to jsp expression.,
    e.g.,
    <input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
    function submitform1(String s)
          var s1 = s
    document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
           document.form1.submit();
          return false;
    /*  i want to pass the values thru session whether it is possible */
    pls give sample code
    Reply
    Marimuthu

    You don't have the session.
    All you have is HTTP.
    The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
    Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

  • How to pass javascript variable to PLSQL stored procedure

    Hi,
    How can I pass a javascript variable to a database procedure. I have a form with a radio button group and would like to save the value of the selected radio button to a database table by passing the value to the stored procedure.
    Thanks

    Hi
    You can use iframe to call the procedure. Here is an example used in dynamic page or pl/sql portlet. The pl/sql procedure is called myprocedure and resists in the schema myschema. This example passes 2 parameters, but I have not yet reased a limit.
    First the call within a javascript function:
    myiframe.location.href="myschema.myprocedure?p_myprameter1=" + vJvascriptparameter1 + "&p_myprameter2=" + vJvascriptparameter2;
    Then the iframe:
    <iframe id="myiframe" height="0" width="0" frameborder="0"></iframe>
    You can let the pl/sql procedure print a value, that can be used i the portlet. You can get the value in a javascript this way:
    myvalue=top.window.frames["myiframe"].document.body.innerHTML;
    Best regards
    Klaus

Maybe you are looking for

  • How can i delete my itunes account as i think im being hacked, almost every day itunes are taking accessive amounts of money from my account!

    Dear Apple support, how can i delete my itunes account as i think im being hacked!! over the past few months a lot of money seems to be taken from my account ranging from as little as £1 to £60... i cant take any more. Can i delete the account? Can u

  • Synced to another user account??

    After updating iTunes I get an error message when trying to sync my iPod Touch to my PC (Outlook).   It says I'm synced to another user account and asks if I want to merge or replace info.  I'm afraid to do either - not sure if I will lose all my inf

  • Time Machine recovery Help!

    Hi forum. I have Time Machine setup on a MacBook Pro backing up to a Time Capsule. Now the user has lost his iphotos and we want to get them back from the backup. When I "enter" timemachine, I cannot navigate, it seems the interface is locked on "tod

  • How to get a Header UDF value in a FMS ?

    Hi ! How is it possible to get a Header UDF value from a Formatted Search in a header ?  If we don't want to create as many FMS as there are marketing documents in the system, how is it possible ?  Can we have a syntax like the following ? SELECT T0.

  • INDEX GETTING UNUSABLE

    Hello everybody, I'm using Oracle 9i and I'm getting below error when I execute a anonymous block which runs through the cursor and updates the table. ORA-01502: index 'ASAP.PK_STATUS_NO' or partition of such index is in unusable state select query o