The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Javascript Help

4 posters

Go down

Solved Javascript Help

Post by Mike May 19th 2011, 3:55 am

Hi there,

I need some help with JS. Right now I have something that on hover slides and shows something to the right, however I want to show it on the left.

Here's my code:
Code:
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $('#accordion > li').hover(
                    function () {
                        var $this = $(this);
                        $this.stop().animate({'width':'480px'},500);
                        $('.heading',$this).stop(true,true).fadeOut();
                        $('.bgDescription',$this).stop(true,true).slideDown(500);
                        $('.description',$this).stop(true,true).fadeIn();
                    },
                    function () {
                        var $this = $(this);
                        $this.stop().animate({'width':'115px'},1000);
                        $('.heading',$this).stop(true,true).fadeIn();
                        $('.description',$this).stop(true,true).fadeOut(500);
                        $('.bgDescription',$this).stop(true,true).slideUp(700);
                    }
                );
            });
        </script>

If you need a example of it I can show you


Last edited by Drogba921 on May 21st 2011, 6:55 pm; edited 1 time in total
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Javascript Help

Post by ElMuggs May 19th 2011, 5:52 am

If i recall right (and it's a bit tricky coding without being able to see the example) you just need to make one of the numbers a negative to make it go in reverse

I think it's either this line:

$this.stop().animate({'width':'480px'},-500);

or this one:

this.stop().animate({'width':'115px'},-1000);

Hope that helps!
ElMuggs
ElMuggs
Forumember

Posts : 91
Reputation : 17
Language : CSS / HTML / BBcode / Javascript / Graphics and Tech Support yeech..
Location : Deep in the belly of the code

http://wizardswb.forumotion.com

Back to top Go down

Solved Re: Javascript Help

Post by Mike May 20th 2011, 12:56 am

No, that's the time it takes to do as such. Anyone else?
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Javascript Help

Post by Mike May 21st 2011, 4:27 pm

Is anyone able to help?
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Javascript Help

Post by Gangstar15 May 21st 2011, 5:34 pm

Ya.. can i see the example :=)
Gangstar15
Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Javascript Help

Post by Mike May 21st 2011, 6:09 pm

[Post Removed]
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Javascript Help

Post by Gangstar15 May 21st 2011, 6:21 pm

This is something to do with the CSS not the jQuery Smile
I didn't came to fix it but here is something you may like:
1. go to http://htmledit.squarefree.com/
2. Paste this code and see what will happen:
Spoiler:
Gangstar15
Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Solved Re: Javascript Help

Post by Mike May 21st 2011, 6:26 pm

nah it didnt help. Ill try and use something else.
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Javascript Help

Post by MrMario May 21st 2011, 11:46 pm

Solved => Locked
MrMario
MrMario
Helper
Helper

Male Posts : 22186
Reputation : 1839
Language : test

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum