Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 04-23-2007, 12:36 PM   #1 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 106
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
JS: making invisible text (display:none) non-selectable

here's the problem i'm having. i've got a webpage that displays various stats for me. each stat is a link that toggles the visibility of a div right below it, which gives further info on that topic. every day i like to copy and paste my stats and save themn to a txt fie, but i don't need to save the details, just the main stats. however, when i highlight all of the text and Copy, it's copying the invisible text as well. i need to make the text non-selectable while it's invisible.

here's what i have:


<script type="text/javascript">
function toggle(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = 'block';
}
}
</script>



<a href="#" onClick="toggle('details1')" style="color:#000000; text-decoration:none">the numbers for this stat is: 1234</a><br><div id="details1" style="display:none">some info<br>more info<br>etc<br></div>
...
the numbers for this stat is: 567
...


so if i try to copy just the "the numbers for..." text, when i paste it, it pasts the detail;s info as well, even tho it's not even visible.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

 


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if you are invisible.. pukenerampa Forum Lobby 47 05-26-2006 10:39 AM
CSS making part of my site invisible! JamieJelly Coding Forum 4 05-01-2006 12:01 PM
making graphics with php - problem with text gnznroses Coding Forum 3 04-15-2006 05:26 PM
Will invisible text hurt seonewbee Google Forum 5 10-03-2004 04:45 PM
PHP=> a text box and making breaks when needed.. HELP PLE Izzmo Coding Forum 5 07-16-2004 12:54 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:35 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.