Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2011
    Posts
    71
    Member #
    28914
    Liked
    1 times
    Made a page that changes the content div as you click "home," "about," etc. Doesn't work in IE. anyone ran into this problem???

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    many IE isolated issues are in the DOC Type declaration and not defining some elements properly. IE is probably the worst for inserting it's own element values if you don't.

  4. #3
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Going to need a heck of a lot more info to help you.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  5. #4
    Member
    Join Date
    Aug 2011
    Posts
    71
    Member #
    28914
    Liked
    1 times
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>SEO Detail click Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    * {
    background-color:white;
    }
    #triggers {
    float:left;
    border:1px solid #ccc;
    }
    #triggers div {
    cursorointer;
    }
    #zero {
    display:none;
    color:red;
    }
    #first {
    color:blue;
    }
    #second {
    color:green;
    }
    #third {
    color:#a52a2a;
    }
    </style>
    <script type="text/javascript">
    if(document.getElementById)
    document.write('<style type="text/css">.detail {float:left;display:none;}#zero {display:block;}<\/style>');
    function reveal(det){
    if(!document.getElementById) return;
    if (!document.getElementsByClassName){
    document.getElementsByClassName = function(cn){
    cn = cn.replace(/ +/g, ' ').split(' ');
    var ar = [], testname = function(n){
    for (var re, i = cn.length - 1; i > -1; --i){
    re = new RegExp('(^|\W)' + cn + '(\W|$)');
    if(!re.test(n)) return false;
    }
    return true;
    }
    for(var d = document.all || document.getElementsByTagName('*'), i = 0; i < d.length; ++i)
    if(testname(d.className))
    ar[ar.length] = d;
    return ar;
    };
    document.getElementsByClassName.spoof = true;
    }
    for (var d = document.getElementsByClassName('detail'), i = d.length - 1; i > -1; --i)
    d.style.display = 'none';
    document.getElementById(det).style.display = 'block';
    if (document.getElementsByClassName.spoof)
    document.getElementsByClassName.spoof = document.getElementsByClassName = null;
    }
    </script>
    </head>
    <body>
    <div id="triggers">
    <div onclick="reveal('first');">
    1st Trigger
    </div>
    <div onclick="reveal('second');">
    2nd Trigger
    </div>
    <div onclick="reveal('third');">
    3rd Trigger
    </div>
    </div>
    <div class="detail" id="zero">
    This would be what people would see at page load.
    </div>
    <div class="detail" id="first">
    This would be what people would see for the first clicked content.
    </div>
    <div class="detail" id="second">
    This would be what people would see for the second clicked content.
    </div>
    <div class="detail" id="third">
    This would be what people would see for the third clicked content.
    </div>
    </body>
    </html>

  6. #5
    Member
    Join Date
    Aug 2011
    Posts
    71
    Member #
    28914
    Liked
    1 times
    ^^^That is a real simple example, but this is essentially what I'm having a problem

  7. #6
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    That code didn't work on Dynamic Drive either... too many errors in the JS.

    Try This:

    it uses jQuery:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Copied from: http://www.dynamicdrive.com/forums/a...8.html</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    * {
    color: #000;
    background-color: #fff;
    font: normal 95% verdana, arial, sans-serif;
    }
    .triggers {
    float: left;
    border: 1px solid #ccc;
    padding: 0.5em;
    }
    .triggers div {
    cursor: pointer;
    text-decoration: underline;
    padding: 0.25em 0;
    }
    .details {
    float: left;
    position: relative;
    width: 20em;
    margin-left: 0.5em;
    }
    .details div{
    border: 1px solid #66e;
    padding: 0.5em;
    }
    #default {
    display: block;
    background-color: #ddd;
    }
    #first {
    color: blue;
    background-color: #ffd;
    border-color: gray;
    }
    #second {
    color: green;
    background-color: #eff;
    border-color: green;
    }
    #third {
    color: #a22;
    background-color: #fed;
    border-color: red;
    }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs.../jquery.min.js"></script>
    <script type="text/javascript">
    (function($){
    $('head').append('<style type="text/css">.details div {position:absolute;left:0;top:0;display:none;}</style>');
    $(function(){
    function reveal(det){
    if(det.css('display') === 'block'){return;}
    $('.details div').stop(true, true).not(det).fadeOut('slow');
    det.fadeIn('slow', fixIEfade);
    }
    var $trigs = $('.triggers div').click(function(){
    reveal($('.details div').eq($trigs.index(this)));
    }), fixIEfade = (function(){/*@cc_on @*//*@if(@_jscript_version >= 5)
    if($.browser.version < 8){
    return function(){
    if(this.style.getAttribute){
    this.style.removeAttribute('filter');
    }
    };
    }@end @*/
    return function(){return;};
    })();
    });
    })(jQuery);
    </script>
    </head>
    <body>
    <div class="triggers">
    <div>
    Default
    </div>
    <div>
    1st Trigger
    </div>
    <div>
    2nd Trigger
    </div>
    <div>
    3rd Trigger
    </div>
    </div>
    <div class="details">
    <div id="default">
    This is what people will see at page load. Default Message
    </div>
    <div id="first">
    This is what people will see when they click the first link
    </div>
    <div id="second">
    This is what people will see when they click the second link
    </div>
    <div id="third">
    This is what people will see when they click the third link... and it's SEO Friendly because it's using JQuery, see the original code at: <a href="http://www.dynamicdrive.com/forums/a...p/t-60928.html">Dynamic Drive</a>
    </div>
    </div>
    </body>
    </html>

  8. #7
    Member
    Join Date
    Aug 2011
    Posts
    71
    Member #
    28914
    Liked
    1 times
    actually...Great points were made, but really...I just had to change the doctype. What is dynamic Drive? browser?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:38 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com