Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 50

Thread: javascript help

  1. #11
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Should do the trick, and hope that helps. Let me know how it goes.

  2. #12
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    thanks. I will

  3. #13
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    (*%$)*$)(*#(*

    I got it working, I changed it a bit and it still worked.

    I added the code to add the links and %_*)*)*(%^#

    PHP Code:
    <head>
        <
    style>
        
    div.div_3sg
        
    {
            
    width100%;
        }
        
    div.tab_3sg
        
    {
            
    border1px solid;
            
    marginauto;
            
    clearboth;
            
    height120px;
            
    width98%;
            
    padding-left4px;

        }
        
    #tabs li {
            
    list-stylenone outside none;
        }
        
    #tabs ul {
            
    padding0;
            
    border-bottom0 none !important;
        }

        
    #tabs li, #tabs li a {
            
    floatleft;
        }
        
    #tabs ul li{
            
    font-weightbold;
            
    padding8px;
            
    text-decorationnone;
            
    cursorpointer;
        }
        </
    style>
      <
    script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    </head>
    <body>
    <div id="tabs" class="div_3sg">
        <div  id="tabHeader"  style="display: block; float: left; ">
           <ul  id="tabUl" >
                <!-- Tabs Generated Here -->
           </ul>
        </div>
        <!-- Tabs Generated Here -->
    </div>
    <div id="hidden" style="display:none" class="user_css"><label id="text_color">text</label><a id="link_color" href="#">text</a></div>

    </body>
    <script>
        $(document).ready(function(){
            $.getJSON( "include_js.php",function(data){
                var items = [];

                $.each(data.groups, function(id, group) {
                    $('<li id="#tab-'+(id+1)+'">'+group.name+'</li>').appendTo('#tabUl');

                    var div = '<div id="tab-'+(id+1)+'" class="tab_3sg">';
                    div = div +'<b>'+group.title+'</b><br>';
                    $.each(group.links, function(id, link) {
                        div = div + '<a href="'+link.url+'">'+link.name+'</a><br>';
                    });
                    div = div + '</div>';
                    $(div).appendTo('#tabs');

                });
            });

            $('#tabs .tab_3sg').hide();
            $('#tabs .tab_3sg:first').show();
            $('#tabs ul li:first').addClass('active');
            var text_color = $('#text_color').css("color");
            var link_color = $('#link_color').css("color");
            $('#tabs ul li').css('color',link_color);
            $('#tabs ul li:first').css('color', text_color);

            $('#tabs ul li').click(function(){
                $('#tabs ul li').removeClass('active');
                $(this).addClass('active');
                var currentTab = $(this).attr('id');
                $('#tabs .tab_3sg').hide();
                $(currentTab).show();
                $('#tabs ul li').css('color', $('#link_color').css("color"));
                $(this).css('color', $('#text_color').css("color"));

                return false;
            });

        });
    </script> 
    You can see what its doing on http://3sg.org/beta/3sg_footer.htm

  4. #14
    Stuper Moderator
    Join Date
    Jul 2010
    Owner Since
    January 2003

    Posts
    1,108
    Thanks
    395
    Thanked 638 Times in 383 Posts
    Quote Originally Posted by Alan92RTTT View Post
    You can see what its doing on http://3sg.org/beta/3sg_footer.htm
    The bottom cell, the 1st clickable link is underneath of the header text for that cell. Can not click on it. I'm viewing with Chrome.

    Jeremy

    Quote Originally Posted by Echo419 View Post
    Douches

  5. #15
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    if the javascript was working that would not be an issue

    That page should look/work like the block at the bottom of the page here when its done.

  6. #16
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Quote Originally Posted by Alan92RTTT View Post
    (*%$)*$)(*#(*

    I got it working, I changed it a bit and it still worked.

    I added the code to add the links and %_*)*)*(%^#
    So close. Now the problem is the div.tab_3sg CSS parameter. You have it set to a static height of 120px, when perhaps it might be better suited to use a min-height:120px instead.

  7. #17
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    Height is not the issue unless the JS is working in your browser.

    this part of the JS is not running in FF
    PHP Code:
           $('#tabs .tab_3sg').hide();
            $(
    '#tabs .tab_3sg:first').show();
            $(
    '#tabs ul li:first').addClass('active');
            var 
    text_color = $('#text_color').css("color");
            var 
    link_color = $('#link_color').css("color");
            $(
    '#tabs ul li').css('color',link_color);
            $(
    '#tabs ul li:first').css('color'text_color);

            $(
    '#tabs ul li').click(function(){
                $(
    '#tabs ul li').removeClass('active');
                $(
    this).addClass('active');
                var 
    currentTab = $(this).attr('id');
                $(
    '#tabs .tab_3sg').hide();
                $(
    currentTab).show();
                $(
    '#tabs ul li').css('color', $('#link_color').css("color"));
                $(
    this).css('color', $('#text_color').css("color"));

                return 
    false;
            }); 

  8. #18
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Height is an issue when you are programmatically trying to cram more vertical content into a div than you have made room for via CSS.

    I know this because the text overlap under your third header is from the runoff of the div above it.

    I have updated my version to demonstrate/help:

    http://stealthify.com/3sgto/projects/3sgTabs.php

  9. #19
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    But I see what you're saying. Your JavaScript wasn't working in my browser, but even so you would still have a runoff outside of the container div.

    The version I just posted should solve that. Hope that helps.

  10. #20
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    Runoff issue fixed in my version.

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
  •  
The 3000GT/Stealth/GTO Web History Project
3000gt.com
3000GT / Stealth International WWWboard Archive
Jim's (RED3KGT) Reststop
3000GT/Stealth/GTO Information and Resources
Team 3S
3000GT / Stealth / GTO Information
daveblack.net
3000GT/Stealth/GTO Clubs and Groups
Michigan 3S
MInnesota 3S
Wisconsin 3S
Iowa, Nebraska, Kansas 3S
North California 3000GT/Stealth
United Society of 3S Owners
3000GT/Stealth/GTO Forums
3000GT/Stealth International
3000GT/Stealth/GTO Event Pages
3S National Gathering
East Coast Gathering
Upper Mid-West Gathering
Blue Ridge Gathering