Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Padding list

  1. #1
    Join Date
    Dec 2008
    Posts
    35
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Padding list

    I have been looking at this and i can't get it working. So i was wondering if some of you could help me get it working or see if there is a better way to create a bar like that.
    Last edited by saynogo9999; 01-04-2009 at 11:18 AM.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You could achieve the same effect with jQuery but if you want help with the MooTools one:

    Please post a link to the page on your site that contains the problematic script or attach your code so we can check it out.

  3. #3
    Join Date
    Dec 2008
    Posts
    35
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Yes, i need for my blog http://fluzzh.blogspot.com/. And i need it to be placed in the sidebar. Currently ive deleted it.

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Add this to your the head section of your page:
    HTML Code:
    <script type="text/javascript" src="http://demos111.mootools.net/demos/mootools.svn.js">
    </script>
    <script type="text/javascript">
        window.addEvent('domready', function(){
            var list = $$('#idList li');
            list.each(function(element){
                var fx = new Fx.Styles(element, {
                    duration: 200,
                    wait: false
                });
                element.addEvent('mouseenter', function(){
                    fx.start({
                        'margin-left': 5,
                        'background-color': '#666',
                        color: '#ff8'
                    });
                });
                element.addEvent('mouseleave', function(){
                    fx.start({
                        'margin-left': 0,
                        'background-color': '#333',
                        'color': '#888'
                    });
                });
            });
        });
    </script>
    <style type="text/css">
        #idList {
            margin: 0;
            padding: 0;
        } #idList li {
            display: block;
            margin: 0;
            padding: 4px;
            width: 120px;
            background: #333;
            color: #888;
        }
    </style>
    and this to the body section where you want the menu to appear:
    HTML Code:
    <ul id="idList">
        <li>
            option 1
        </li>
        <li>
            option 2
        </li>
        <li>
            option 3
        </li>
        <li>
            option 4
        </li>
        <li>
            option 5
        </li>
        <li>
            option 6
        </li>
        <li>
            option 7
        </li>
        <li>
            option 8
        </li>
        <li>
            option 9
        </li>
        <li>
            option A
        </li>
        <li>
            option B
        </li>
        <li>
            option C
        </li>
        <li>
            option D
        </li>
        <li>
            option E
        </li>
        <li>
            option F
        </li>
    </ul>
    Good luck!
    Last edited by Snookerman; 01-04-2009 at 10:49 AM.

  5. #5
    Join Date
    Dec 2008
    Posts
    35
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Thanks!

  6. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You're welcome and good luck with your site! You can go to your first post in this thread, click then Go Advanced and add the Resolved prefix to the thread title. This will let other users know the problem has been solved.

  7. #7
    Join Date
    Dec 2008
    Posts
    35
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Could i do this with a tab menu so the background image fades in??
    Like:

    Code:
    <script src='http://demos111.mootools.net/demos/mootools.svn.js' type='text/javascript'/>
    <script type='text/javascript'>
        window.addEvent('domready', function(){
            var list = $$('#foxmenu li');
            list.each(function(element){
                var fx = new Fx.Styles(element, {
                    duration: 200,
                    wait: false
                });
                element.addEvent('mouseenter', function(){
                    fx.start({
                        'margin-left': 0,
                        'background': 'url(http://www.saynogo.com/images/tabs.jpg) no-repeat top left',
                    });
                });
                element.addEvent('mouseleave', function(){
                    fx.start({
                        'margin-left': 0,
                        'background': 'url(http://www.saynogo.com/images/tabs.jpg) no-repeat top right',
                    });
                });
            });
        });
    </script>

  8. #8
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    I'm not really sure since I don't usually use MooTools. Try it out and see what happens. Just one thing that might cause you problems, don't put a comma after the last "item". So in your example, remove the highlighted:
    Code:
    fx.start({
         'margin-left': 0,
         'background': 'url(http://www.saynogo.com/images/tabs.jpg) no-repeat top right',
    });

  9. #9
    Join Date
    Dec 2008
    Posts
    35
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Nope.. Can't get that working, properly something with the mootools script.. But thanks anyway

  10. #10
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    If you used the code you posted, you won't see any difference since you have the exact same values in both places.

Tags for this Thread

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
  •