Solved

Html: how can I hide this line untl a certain event occurs

Posted on 2011-09-11
2
171 Views
Last Modified: 2012-05-12
how can I hide this line untl a certain event occurs

<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <p class="slide" align="center"><font size="1">Select a listing & click here to View Map</font></p></a>

----- I have no way of excuting this function??

<script type="text/javascript">
 function show()
   {
       if (window.location.href.indexOf("RecordID")>0)
       {
document.getElementById("show").style.display = "block";
alert("your url contains the name RecordID");

       }      
     
   };
</script>
0
Comment
Question by:westdh
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 36519578
How about on page load?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled</title>
<style type="text/css">
</style>
</head>
<body onload="javascript:showOrHide('ExpColLink');">
<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <span class="slide" style="text-align:center;font-size:1em">Select a listing & click here to View Map</span></a>
<script language="JavaScript" type="text/javascript">
 function showOrHide(ele) 
   {
       if (window.location.href.indexOf("RecordID")>0) 
       {
            document.getElementById(ele).style.display = "block";
            alert("your url contains the name RecordID");
       } 
       else 
       {
            document.getElementById(ele).style.display = "none";
       }      
      
   }
</script>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:westdh
ID: 36523133
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Changing Two Areas of a Page 5 27
If condition on Html with Asp 11 29
Html CheckBox obtain Its Value 5 28
JavaScript Loan Calculator Error 3 19
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question