SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    start a slide closed

    Hi,
    I try to start a site with a closed Fx.Slide(). What I have:

    Code:
    $$('div.cont_inside').each(function(el) {
    		
    					el.set('slide', { 
    					
    						mode: 'vertical',
    						duration: 'short'
    						}).hide();
    
    				});
    HTML Code:
    <a href="#" onClick="$$('.cont_inside')[0].slide('toggle'); return false;">navi 1</a>
    The slide starts closed but dont comes up on click. Without the '.hide()' it works normal. Only want to
    start the slide in closed condition.

    Thanx for help

    w/regards
    Michael

  2. #2
    SitePoint Addict WolfShade's Avatar
    Join Date
    Mar 2014
    Location
    St. Louis, MO, USA
    Posts
    253
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    In your code, you have two '$' in the onClick. Is that copied/pasted from your actual code? If so, take out one of the '$'.
    V/r,

    ^_^
    WolfShade The Spamhater

  3. #3
    SitePoint Member
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    thanx for your answer. I dont know what you exactly mean. $$ returns a collection and I take the first [0] of them. Without it comes to
    TypeError: $(...) is null
    I just want to know how to hide an element on startup. The first toggle should be the reveal of the element.. not the dissolve.

    w/regards
    Michael

  4. #4
    SitePoint Member
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ... the solution is:

    Code:
    $$('div.cont_inside').each(function(el) {
    		
    					el.set('slide', { 
    					
    						mode: 'vertical',
    						duration: 'short'
    						}).slide ('hide');
    
    				});

  5. #5
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Quote Originally Posted by Lengen1971 View Post
    ... the solution is:

    Code:
    $$('div.cont_inside').each(function(el) {
    		
    					el.set('slide', { 
    					
    						mode: 'vertical',
    						duration: 'short'
    						}).slide ('hide');
    
    				});
    Sorry if I missed something, but isn't this identical to post one.


    Quote Originally Posted by WolfShade View Post
    In your code, you have two '$' in the onClick. Is that copied/pasted from your actual code? If so, take out one of the '$'.
    In the Prototype library, the double dollar selector takes an arbitrary number of CSS selectors (strings) and returns a document-order array of extended DOM elements that match any of them.
    I'm guessing that's what the OP is using.

  6. #6
    SitePoint Member
    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Sorry if I missed something, but isn't this identical to post one.

    In the Prototype library, the double dollar selector takes an arbitrary number of CSS selectors (strings) and returns a document-order array of extended DOM elements that match any of them.
    I'm guessing that's what the OP is using.
    Nope. There are still two dollars but 'slide ('hide')' instead of hide ().
    Last edited by Pullo; Jul 13, 2014 at 11:01. Reason: Moved reply to outside of quote

  7. #7
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,938
    Mentioned
    214 Post(s)
    Tagged
    12 Thread(s)
    Ah. Missed that. Cheers


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •