A better way to display a dynamic text? (or a hidden text penalty)

3 replies
  • SEO
  • |
Very often we want to make our webpages change text as we hover things or change tabs for example.

The most common way of doing so I believe, is to make one visible div, or container, and place the rest as hidden, that contain text and are being conditionally displayed by the means of java-script, eg on hover.

For example (it won't work of course, just for demonstration purpose):
Code:
div:not(:first-child){display:none}
<div>Text1</div>
<div>Text2</div>
<div>Text3</div>
$('div').mouseenter(function(){
    $(this).css('display','block').siblings().css('display','none');
});
Now, let's suppose we have dozens of such containers, each containing a short description of some products.

Though only one is being visible... so questioned myself if such practice may incur penalties. I guessed so because on the query 'products of {company}', it displayed the 'about' page first, but not my products page. And yet there can be other explanations of course, such as dupe penalty, for these same descriptions are also being used at particular product pages.

So I did rewrite my code and utilized json to store my data in a script, instead of stuffing it in the page, something like:
Code:
print 'var data='.json_encode($array).';';
#which would output something like:
var data=['Text1','Text2','Text3'];
$('.somelink').mouseenter(function(){
    $('#main_div').html(data[$(this).index()]);
});
That would use only one div that is always visible, and the rest of the descriptions would be pulled from data, instead of stuffing it in the hidden divs.

I yet have no clue if it would bring any benefits at all or improve my standing, though I would be happy to hear some opinions and thoughts, on which of the practices is considered better and if there is any benefit indeed.
#display #dynamic #hidden #penalty #text
  • Profile picture of the author dburk
    Hi sarged2,

    I use tens of thousands of product pages that contain hidden div elements that reveal text on click, or hover in some cases, with no issues. However, I caution you to not include any links within your hidden divs, that does seem to trigger a trust penalty, even for the most innocent use of that technique.
    {{ DiscussionBoard.errors[7081870].message }}
  • Profile picture of the author sarged2
    Thanks, I never put the links of course and I understand the consequences of doing such tricks.
    Still however, I'm curious what will happen to that hidden text from the rest of the divs? would it get indexed at all? and would additional hidden text contribute to the better rating, or it's just doesn't matter as longs as it's not initially visible?
    {{ DiscussionBoard.errors[7081977].message }}
  • Profile picture of the author sarged2
    Ha, Actually I'm gonna stick with a script/json version, since it gets me a much better keyword density.
    {{ DiscussionBoard.errors[7082124].message }}

Trending Topics