Show/hide Layer Dependent On Browser
Jun 17, 2005
I'm using the scroll function with a layer containing a graphic that sits over the slider on the y axis. This works fine in IE but overhangs the lower scrollbar arrow in Netscape, Firefox and Opera, killing its functionality, so I'd like to hide it in these browsers.
Could someone show me the best way to work a function that says (taking the layer ID as 'Bar')
IF browser = IE
THEN 'Bar' = visible
or (better?)
IF browser <> IE
THEN 'Bar' = hidden
And how should I allow this to behave in Safari?
View 19 Replies
ADVERTISEMENT
Jan 30, 2009
I'm looking to show/hide a layer in a 5 second rotation.
IE: For 5 seconds the layer is shown, then the next 5 seconds it is hidden, the next 5 seconds it is shown, the next 5 seconds it is hidden... {ad nauseum} - you get the idea.
How could I accomplish this with JavaScript? The layer id="overlay"
View 2 Replies
View Related
Aug 6, 2005
Found a simple script to show and hide layers. Using this to have an ad with 60px height and onMouseOver 350px
function adtechhideElement(elmID)
{
for (i = 0; i < document.all.tags(elmID).length; i++)
{
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent) continue;
obj.style.visibility = "hidden";
}
}
function adtechshowElement(elmID)
{
for (i = 0; i < document.all.tags(elmID).length; i++)
{
obj = document.all.tags(elmID)[i];
if (! obj || ! obj.offsetParent) continue;
obj.style.visibility = "";
}
}
but the thing is this doesn't work in firefox/mozilla.
Where should I alter this to get it working in firefox?
View 3 Replies
View Related
Aug 16, 2010
I am trying to develop an exam system.Find my code below.I request you to copy the code and save it as an html file .I have 2 problems:
1. Kindly notice that when the quiz is loaded,it shows both the questions by default.I want only question 1 to be visible when the quiz loads.What happens presently is that ,both questions are visible even after I click on the link
Q.1( referring to question 1).However,when I click on
Q. 2,then only question 2 can be seen and then(after clicking on Q.2) if I click on Q.1,then only question 1 can be seen
What I want is that when the page loads only question 1 is visible.Then when I click on Q.2,I can see only question 2 and when I click on Q.1, I can see only question 1.I later plan on adding many questions,so it should be a general solution rather than a solution good only for 2 questions.
2.Also,what I want is that,if someone selects any of the answers of a particular question,it's link color should turn green to indicate to the user that he answered that question.So for,instance,if I select an answer to the first question(select one of London,New York,Seattle,Washington,Chicago), the link Q.1 should turn green.
View 3 Replies
View Related
Jun 30, 2006
Since the code is triggered ever onclick event it may be resource hungry on large pages.
I guess desired upgrades to suit it more for general purpose and reuse would be:
1> Replace document.write with a way of altering the CSS class rule property. Hard part on this after reading quirksmode would be in targeting the CSS rule in a cross browser, not to intensive way.
2> Find a better cross browser trigger attachment than the current firing on every click.
<!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>Spinner Test</title>
<style type="text/css">
<!--
.spinnerContainer {}
.spinnerLink {cursor: pointer;}
.spinnerContent {display: block;}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
document.onclick=function(evt){
//Credit to Beagle and coding forums http://www.codingforums.com/showthread.php?t=90062
if(!evt){evt=window.event;} // *** IE fix ***
var spinner;// *** element that got clicked ***
// *** Credit to PPK from quirksmode.org for this block ***
if(evt.target){spinner=evt.target;}
else if(evt.srcElement){spinner=evt.srcElement;}
if(spinner.nodeType==3){spinner=spinner.parentNode;} // defeat Safari bug
if(spinner.className=='spinnerLink'){
var contentDiv=spinner.nextSibling;
if(contentDiv.nodeType==3){contentDiv=contentDiv.nextSibling;}
//Action
if(contentDiv.style.display!='block'){contentDiv.style.display='block'}else{contentDiv.style.displa y='none'}
}//from: if(spinner.className=='spinnerLink'){
}//from: document.onclick=function(evt){
document.write('<style type="text/css">.spinnerContent {display: none;}</style>');
</script>
</head><body><br/><br/>
<div class="spinnerContainer">
<span class="spinnerLink">SPIN!</span>
<div class="spinnerContent">Content</div>
</div>
<br/><br/>
<div class="spinnerContainer">
<span class="spinnerLink">SPIN! 1</span>
<div class="spinnerContent">Content 1</div>
</div>
</body></html>
View 1 Replies
View Related
Aug 10, 2005
alert(xmlhttp.responseText);
gives a system error number: -1072896658
I have declared the object using:
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
It works with IE version 6.0.2600 but not with IE version 6.0.2800
Couldnt find wat tis error code 1072896658.
View 4 Replies
View Related
Sep 12, 2011
I am trying to hide/show table when hide/show button is pressed
Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.
Code:
View 1 Replies
View Related
Jul 15, 2010
I found this script on a tutorial site but it had no summary of browser compatibility or any other issues. I know absolutely nothing about javascript and, although it works fine when I test it,
<head>
<script type="text/javascript">
lastone='empty';
function showIt(lyr)
[Code]...
View 7 Replies
View Related
Apr 24, 2007
I built a dynamic ajax suggest engine, and you would think I could
figure this out, but I am having a brain cramp. When I don't have any
characters in the search box, it shows a little blip of the layer
where the suggestion results go...
How do I make this go away? Something along the lines of
if ( document.getElementById('txtSearch').length == 0){
thelayer.style.display=(thelayer.style.display=="none");
}???
View 1 Replies
View Related
Nov 16, 2005
I've already posted a question related to this but i'm not getting the desired solution.U people might have seen the search this forum link in this forum.On clicking that link a div layer opens and if I click the mouse anywhere outside this layer it suddenly hides.I'm using a similar layer function in my site.By clicking a link in my site a layer opens and if I click my mouse outside the layer it should be hidden.So how to do this using javascript.
View 13 Replies
View Related
Aug 22, 2011
I am using CSS text-shadow but of course IE doesn't like it. I've looked into some methods for achieving the same effect in IE, but it's not at all the same so I've opted for another method..I'm going to have two layers. In layer1, it will be standard text, shadowed with CSS. I then screenshotted that and will use the resulting jpeg for layer2.I was then planning to find a script that:1. Detects if browser is IE2. If IE, layer2 is visible, layer1 is invisible3. If not IE, layer1 is visible, layer2 is invisibleThe problem is that I can't find a simple script to detect if the browser's IE or not. I can find loads of scripts that check what version of IE someone's using. The version isn't important!
View 5 Replies
View Related
Jul 20, 2005
Can someone help me figure out how to show a hidden layer *ONLY* if the
browser is IE for windows? I want it to remain hidden for everything else,
Netscape, Opera, Mozilla and anything for Mac. I'm not having much luck
out here.
View 4 Replies
View Related
Feb 10, 2006
Below code creates a tabbed navigation. Works well. But how do I set it up so Tab 1 shows when the page is loaded?
Code:
<script type="text/javascript">
function initShowHide() {
if (document.getElementById && document.getElementsByTagName && document.createTextNode) {
hide();
var toggle = document.getElementById('toggle');
var as = toggle.getElementsByTagName('a');
for (var i = 0; i < as.length; i++) {
as[i].onclick = function() {
show(this);
return false;
}
}
}
}
function show(s) {
hide();
var id = s.href.match(/#(w.+)/)[1];
document.getElementById(id).style.display = 'block'
}
function hide() {
var toggleable = document.getElementById('toggleable').getElementsByTagName('div');
for (var i = 0; i < toggleable.length; i++) {
toggleable[i].style.display = 'none'
}
}
window.onload = initShowHide;
</script>
<style type="text/css">
#tabsB {
width:100%;
font-size:93%;
line-height:normal;
}
#tabsB ul {
margin:0;
padding:2px 10px 1px 0px;
list-style:none;
}
#tabsB li {
display:inline;
margin:0;
padding:0;
}
#tabsB a {
float:left;
background:url("tableftB.gif") no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
#tabsB a span {
float:left;
display:block;
background:url("tabrightB.gif") no-repeat right top;
padding:5px 15px 4px 6px;
color:#666;
}
/* Commented Backslash Hack hides rule from IE5-Mac */
#tabsB a span {float:none;}
/* End IE5-Mac hack */
#tabsB a:hover span {
color:#000;
}
#tabsB a:hover {
background-position:0% -42px;
}
#tabsB a:hover span {
background-position:100% -42px;
}
</style>
</head>
<body>
<table width="50%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<tr>
<td><div id="tabsB">
<div align="left">
<ul id=toggle>
<li><a href="#1"><span>1 </span></a></li>
<li><a href="#2"><span>2</span></a></li>
<li><a href="#3"><span>3</span></a></li>
</ul>
</div>
</div></td>
</tr>
<tr>
<td bgcolor="#F7F7F7" style="border-bottom:1px solid #CCCCCC; border-left:1px solid #CCCCCC;border-right:1px solid #CCCCCC;">
<div id="toggleable">
<div id="1">Tab 2</div>
<div id="2">Tab 2</div>
<div id="3">Tab 3</div>
</div></td>
</tr>
</table>
View 1 Replies
View Related
Mar 1, 2010
I want the hidden layer to open when the visitor clicks and stay open until they click the close x. I can get the hidden layer to show onMouseover, but not onclick.
Code:
<script type="text/javascript"> // Copyright 2006-2007 javascript-array.com var timeout= 500; var closetimer= 0; var ddmenuitem= 0; // open hidden layer function mopen(id) { // get new layer and show it ddmenuitem = document.getElementById(id);
[Code]....
I find script that does something similar and adapt it to do what I need it to do. Usually, I can work it out on my own - but I have been working on this for several days now.
View 2 Replies
View Related
Apr 4, 2002
Layer writing in Netscape. This is pretty straightforward >> However I'm trying to write to a <div> layer within a <div> layer.
My div:
Code:
<div id="blah">
<div id="aight">
</div>
</div>
I'm trying to write to "aight"
How should my code look?
View 3 Replies
View Related
Jan 30, 2009
I have created a floating layer using Javascript that remains always on top of page on scrolling.Issue is,at some point while scrolling,the layer flickers continuously.
The html page is as follows:
Many common software systems, JavaScript has a history of security problems. Many of these problems could allow a person with malevolent intent to steal sensitive information from a visitor. The number and type of such holes in security vary among browsers and operating system versions. Most JavaScript security holes have been caught and fixed, but new ones are being discovered all the time. For a list of current security holes check out your browser's and operating system's Web pages. As a Web site author, it is your responsibility to keep up-to-date on the current status of known security holes in the applications you create.
Signing Scripts. In Chapter 11, I explained that JavaScript does not provide the ability to directly access files on the client computer. This can be a very large hurdle to overcome if you're trying to upload a file to a server from the client computer. Fortunately, file uploading is one of many functional enhancements that signed scripts provide. Signed scripts are specially packaged scripts that have been verified and signed to be correct and non-threatening. These scripts have additional rights on the client computer that allow a programmer to do many things that he wouldn't otherwise be able to.
With the introduction of Netscape 4.0, a new security model was put in place that would allow digitally signed scripts to bypass some of the restrictions that had previously been placed on them. A signed script can request expanded privileges from the visitor and, with the visitor's permission, gain access to restricted data. A signed script requests these additional permissions through LiveConnect, which allows your JavaScript code to communicate with the Java Capabilities API. The security model allows JavaScript to access certain classes in Java in order to extend its functionality while still maintaining tight security for the client.
A digital signature is a fingerprint of the original programmer, and it allows the security model of the browser to detect where (or from whom) it originated. A script signer can be a person or an organization. By signing a script, you acknowledge yourself as the author and accept responsibility for the program's actions. A signed script contains a cryptographic checksum, which is just a special value that ensures the signed script has not been changed. When a digital signature is detected, you are assured that the code has not been tampered with since the programmer signed it.
Once you finish writing a script, you can use the Netscape Signing Tool to digitally sign it. Signing a script does the following:
Unambiguously assigns ownership of the script to a person or organization.
Allows an HTML page to use multiple signed scripts.
Places the signed script into a Java Archive (JAR) file.
Places the source of the script in the JAR file.
Once a user confirms the origin of the script and is assured that it has not been tampered with since its signing, he or she can then decide whether to grant the privileges requested by the script based on the validated identity of the certificate owner and validated integrity of the script.
JAVASCRIPT FILE IS AS FOLLOWS:
AND CSS FILE IS AS FOLLOWS:
At some point while scrolling,the div 'movable' flickers continuously,while at some other point,it is perfectly stable.
View 11 Replies
View Related
Jan 22, 2009
I am having problems, basically I have a set of nested lists I need to show and hide
Code:
<ul id="smenu3"><ul id="smenu4">
<li>stuff here..</li>
<li>stuff here..</li>
<li>stuff here..</li>
</ul><ul id="smenu5">
[Code]...
I always want "smenu3" to show with "smenu4" and "smenu5" collapsed... When the user clicks the link, it calls a javascript function to show "smenu4" like so...
[Code]...
View 7 Replies
View Related
Sep 4, 2009
Okay, I'm having some trouble getting my head around how to do this..
<select>
<option value="A">A</option>
<option value="B">B</option>
[code]....
View 1 Replies
View Related
Aug 3, 2009
I have to hide the url from bowser. I want to hide real URL and display to the specific URL on browser.
View 3 Replies
View Related
Nov 25, 2010
I want to hide the browser address bar when open a new window. I can hide menu bar, status bar, etc except address bar.
View 5 Replies
View Related
Jul 5, 2006
I know how to click a link to show a hidden div. However, how can I hide the div when users click anywhere in the browser? I would like some behaviour like "releaseOutside" in javascript.
I search this forum and find some code to try, but it doesn't work. When I click the link, the div does not show anymore (if I took out the document.onclick function, the div shows). Here is my code:
<script language="javascript" type="text/javascript">
function showdiv() {
document.getElementById("mydiv").style.display = "block";
return false;
}
document.onclick = function() {
document.getElementById("mydiv").style.display = "none";
}
</script>
</head>
<body>
<a href="#" onclick="return showdiv()">Link</a>
<div id="mydiv" style="display:none">bah bah bah...</div>
View 2 Replies
View Related
May 10, 2010
I want to hide the browser address bar when open a new window. I can hide menu bar, status bar, etc except address bar.
View 4 Replies
View Related
Jan 21, 2011
Why does a comment tag hide the havascript if the browser does not support javascript? I thought comment tags were for comments not to hide things...
View 4 Replies
View Related
Sep 23, 2007
In my course on website design we just started some JavaScript. In the very first assignment nothing shows in my browser. I have two questions:
Is there a way to get it to show in my browser so I can complete the assignment?
Is JavaScript widely unviewable? Here is the script I used:
<script language="JavaScript">
<!Hide from non-JavaScript browsers
document.write("Today is 12/15/2003<br>");
document.write("Only 10 days until Christmas");
//Stop hiding -->
</script>
View 3 Replies
View Related
Aug 2, 2010
My problem is : I have an image file located on the client machine in the 'd:imageemp1.jpg' I want to make a function that accepts the image filename -"d:imageemp1.jpg" as a parameter and display the image in anew page in the browser.
View 1 Replies
View Related
Aug 11, 2005
I am trying to hide some form elements in a form by default and show/hide
depending on which radio button is clicked. This is what I have but it is
not working: Code:
View 2 Replies
View Related