Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-21-2008, 05:09 PM fx.slide - toggle
coldturkey's Avatar
Extreme Talker

Posts: 211
Name: Rachel
Location: Spain
Trades: 3
Okay so this is from mootools... but i can't do one thing...
You'll see on this page - forget design - im sorting out codes....
http://www.spanglishwebs.com/newdesign.php
You'll see it says options at the top left... if u click this does up to get rid of the menu bar. I'd like it to be the other way round... so when the page loads the menu bar isnt there and you have to click on options to bring the bar down.

This is the mootools code for this:
Code:
Fx.Slide = Fx.Base.extend({

    initialize: function(el, options){
        this.element = $(el).setStyle('margin', 0);
        this.wrapper = new Element('div').injectAfter(this.element).setStyle('overflow', 'hidden').adopt(this.element);
        this.setOptions({'mode': 'vertical'}, options);
        this.now = [];
        this.parent(this.options);
    },

    setNow: function(){
        for (var i = 0; i < 2; i++) this.now[i] = this.compute(this.from[i], this.to[i]);
    },

    vertical: function(){
        this.margin = 'top';
        this.layout = 'height';
        this.offset = this.element.offsetHeight;
        return [this.element.getStyle('margin-top').toInt(), this.wrapper.getStyle('height').toInt()];
    },

    horizontal: function(){
        this.margin = 'left';
        this.layout = 'width';
        this.offset = this.element.offsetWidth;
        return [this.element.getStyle('margin-left').toInt(), this.wrapper.getStyle('width').toInt()];
    },

    slideIn: function(mode){
        return this.start(this[mode || this.options.mode](), [0, this.offset]);
    },

    slideOut: function(mode){
        return this.start(this[mode || this.options.mode](), [-this.offset, 0]);
    },

    hide: function(mode){
        this[mode || this.options.mode]();
        return this.set([-this.offset, 0]);
    },

    show: function(mode){
        this[mode || this.options.mode]();
        return this.set([0, this.offset]);
    },

    toggle: function(mode){
        if (this.wrapper.offsetHeight == 0 || this.wrapper.offsetWidth == 0) return this.slideIn(mode);
        else return this.slideOut(mode);
    },

    increase: function(){
        this.element.setStyle('margin-'+this.margin, this.now[0]+this.options.unit);
        this.wrapper.setStyle(this.layout, this.now[1]+this.options.unit);
    }

});
Im using the toggle part - call by this code:
Code:
window.addEvent('domready', function(){
                 var mySlide = new Fx.Slide('contenido-slide');
                 $('toggle').addEvent('click', function(e){
                    e = new Event(e);
                     mySlide.toggle();
                     e.stop();
                 });
             });
Any ideas what i need to change to make it the other way around?
Thanks
Rachel
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

coldturkey is offline
Reply With Quote
View Public Profile Visit coldturkey's homepage!
 
 
Register now for full access!
Old 05-26-2008, 12:13 PM Re: fx.slide - toggle
coldturkey's Avatar
Extreme Talker

Posts: 211
Name: Rachel
Location: Spain
Trades: 3
Dont worry - I have sloved this problem!!!!!
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

coldturkey is offline
Reply With Quote
View Public Profile Visit coldturkey's homepage!
 
Reply     « Reply to fx.slide - toggle
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25437 seconds with 12 queries