Solved

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

Posted on 2011-09-11
2
170 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

770 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