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
JQuery - Slider - Help!!!
Old 07-02-2009, 03:43 PM JQuery - Slider - Help!!!
Junior Talker

Posts: 3
Name: sksksk
Trades: 0
Update: Here's an example http://198-163-465.awardspace.co.uk/index.html

Well i recently got into jquery, ok i started learning it 2 days ago, but i feel as though i'm learning rather quickly - i suppose that's the beauty of jquery - anyway i have been trying to make my own slider type thing, so here's my jquery:

Code:
<script type="text/javascript">
    
    $(function() {
        $('.j_link') .click(function() {
            $('#box2') .animate({"right" : "316px"}, 1000);
            $('#box3') .animate({"right" : "316px"}, 1000);
            $('#box4') .animate({"right" : "316px"}, 1000);
            $('#box5') .animate({"right" : "316px"}, 1000);
            
            $('#box2') .animate({"right" : "316px"}, 1000);
            $('#box3') .animate({"right" : "316px"}, 1000);
            $('#box4') .animate({"right" : "316px"}, 1000);
            $('#box5') .animate({"right" : "316px"}, 1000);
        
            $('#box3') .animate({"right" : "632px"}, 1000);
            $('#box4') .animate({"right" : "632px"}, 1000);
            $('#box5') .animate({"right" : "632px"}, 1000);
            
            $('#box3') .animate({"right" : "632px"}, 1000);
            $('#box4') .animate({"right" : "632px"}, 1000);
            $('#box5') .animate({"right" : "632px"}, 1000);
            
            $('#box4') .animate({"right" : "948px"}, 1000);
            $('#box5') .animate({"right" : "948px"}, 1000);
            
            $('#box4') .animate({"right" : "948px"}, 1000);
            $('#box5') .animate({"right" : "948px"}, 1000);
            
            $('#box5') .animate({"right" : "1264px"}, 1000);
            
            $('#box5') .animate({"right" : "1264px"}, 1000);
        });
    });
    
    </script>
and here's my html:

Code:
<div id="container">

<div id="content">

<div id="box">

</div>

<div id="box2">

</div>

<div id="box3">

</div>

<div id="box4">

</div>

<div id="box5">

</div>

</div>    
</div>

<div id="link">
    <a class="j_link" href="#">Click Here</a>
</div>
i don't know why i called it j_link lol

and here's my css:

Code:
<style type="text/css">

    #container {
        position:absolute;
        width:340px;
        height:350px;
        display:;
        margin:2em;
        overflow:;
        position:relative;
        background:#;
    }

    #content {
        position:absolute;
        width:1800px;
        height:350px;
        display:;
        margin:2em;
        position:relative;
        background:#;
    }

    #box {
        float:left;
        width:300px;
        height:300px;
        display:;
        margin-left:0em;
        margin-bottom:2em;
        margin-right:1em;
        margin-top:0em;
        position:relative;
        background:#ff0000;
    }
    
    #box2 {
        float:left;
        width:300px;
        height:300px;
        display:;
        margin-left:0em;
        margin-bottom:2em;
        margin-right:1em;
        margin-top:0em;
        position:relative;
        background:#0000ff;
    }
    
    #box3 {

        float:left;
        width:300px;
        height:300px;
        display:;
        margin-left:0em;
        margin-bottom:2em;
        margin-right:1em;
        margin-top:0em;
        position:relative;
        background:#ff0000;
    }
    
    #box4 {

        float:left;
        width:300px;
        height:300px;
        display:;
        margin-left:0em;
        margin-bottom:2em;
        margin-right:1em;
        margin-top:0em;
        position:relative;
        background:#0000ff;
    }
    
    #box5 {

        float:left;
        width:300px;
        height:300px;
        display:;
        margin-left:0em;
        margin-bottom:2em;
        margin-right:1em;
        margin-top:0em;
        position:relative;
        background:#ff0000;
    }
    
    #link {
        width:100%;
        height:100px;
        background:#;
    }

    

    </style>
Remeber i only started using JQuery 2 days ago so be fair

All the code works, i was just wondering if there was a way to shoten it 'cause i seems a little long to me??

Last edited by sksksk; 07-02-2009 at 04:18 PM..
sksksk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to JQuery - Slider - Help!!!
 

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 1.16323 seconds with 12 queries