Solved

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

Posted on 2011-09-11
2
169 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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Basic CSS issues 24 33
spacing 5 23
radio button value 3 43
CSS grid style change 2 13
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now