MyElement.style.displays = 'hide';

Jan 24, 2007

i'm playing around with javascript and tried the following:
//a.js

HTML Code:
function oculta() {
var paragrafo = document.getElementById("a");
paragrafo.style.displays = 'hide'
}
window.onload = oculta;
//test.htm

HTML Code:
<html>
<head>
<title></title>
<style type = "text/css"></style>
<script type = "text/javascript" src = "a.js"></script>
</head>
<body>
<p id = "a" >bla bla</p>
</body>
</html>

but nothing happens, either i use 'none', or '' or even 'hide'
what am i doing wrong?

View 9 Replies


ADVERTISEMENT

New Style Sheet - Menu To Reveal / Hide DIV?

May 19, 2009

I have a script that works perfectly on a live site that basically has a menu that reveals a hidden DIV and when you click a link, and then when you click a new link it hides the previous div and reaveals the new one. It is as follows:

Javascript Code:
Original - javascript Code
LastLayer = "nothing"; // the first div/layer
function openObject(theLayer){
// pass the name of the layer you want to bring to the top
// Then hide the last layer, and make the layer passed visible. This could have been done using the z-index property
if (document.getElementById) { // if it's IE5 or NS6 use this syntax to access the visiblity attribute
eval("document.getElementById(LastLayer).style.visibility = 'hidden'")
eval("document.getElementById(theLayer).style.visibility = 'visible'")
LastLayer = theLayer;
}
if(document.layers) { // if it's NS4 use this syntax to access the visiblity attribute
eval('document.layers[LastLayer].visibility = "hidden"')
eval('document.layers[theLayer].visibility = "visible"')
LastLayer = theLayer;
} .....

Now I am redesigning the site to work with a new style sheet, (There wasn't one before, it was all inline styles. Anyway, it broke my script. The CSS has a class that gives certain DIV's visibility attribute the 'hidden' value by default. I was planning on using the above script to reveal/hide them, but it does nothing. Here is the CSS that affects the divs I am referring to.

CSS Code:
Original - css Code
.job {
border: thin solid #000000;
float: right;
margin-right: 25px;
padding-left: 10px;
width: 40%;
display: none;
}
.job { border: thin solid #000000; float: right; margin-right: 25px; padding-left: 10px; width: 40%; display: none;}
As you can see there is nothing fancy in the css that would cause any concern.

View 4 Replies View Related

JQuery :: Obtain ORIGINAL Style Setting - And NOT Computed Style?

May 5, 2010

My understanding had been that $.css("width") would return the original user selected style, eg "100%" or "10em", and $.width() returned the computed width, always in "px". Not so, following the code through for .css(), it calls something called getComputedStyle and the only difference between the two functions turns out to be a post-fix of "px" on the .css() result - not very useful. I need to know whether my user has called me with a proportional dimension, or a fixed one. How to tell with jQuery?

View 1 Replies View Related

Hiding Code Between <style Type=text/css">...</style>

Apr 24, 2009

I have built a website and I wish to hide my code between "style type="text/css">....</style>

Is there a way to hide the code between it?

View 5 Replies View Related

One Grid Displays Numbers, True Or False And Yes Or No, And The Other Grid Displays Letters, True, False, Yes And No?

Feb 15, 2012

I have two grids, they both display buttons. One grid displays numbers, true or false and yes or no, and the other grid displays letters, true, false, yes and no.

The second grid is not displayed in the code (used css to not display second grid buttons (.answerBtns)) Now using the getButtons() function, if the user selects button "1" in first grid (the grid which you have to open using (Open Grid) link, then it should display button "A" in second grid, if user selects button "2" in first grid, then it should displays buttons "A" and "B" in second grid, if "3" then display "A", "B" and "C" and so on.

Now except using if statements and stating which buttons should be displayed and not displayed depending on the button chosen in first grid, is there a more efficent way of coding this so that the display of buttons in second grid depends on what is selected in the first grid?

If it is using an array can somebody show a sample of this in their answer. You can just do it for one example and then I should be able to use that to fill it for the other buttons.

View 1 Replies View Related

JQuery :: Using To Style List-style-type?

Oct 12, 2011

This is probably quite a simple problem but I can't figure out the answer. I'm working on a site that has news stories and events coming in. What I would like is to have the news stories to be styled with squares and events with discs for instance. I might be able to change the actual plug-in so the CSS affects this change, but I just wondered how I could change the list-style-type with jQuery.

[Code]...

View 3 Replies View Related

Getting Element Style Outside The Style Attribute?

Oct 22, 2009

if I have an html page that uses the <style> or a <link> to call a style sheet these properties aren't available to JavaScript is there a good way to access them? eg

<html>
<head>
<title>expandable text area</title>
<style type="text/css">

[Code]....

View 8 Replies View Related

Offsetheight Displays 0 In IE

Nov 14, 2007

i've got a .net page with a table sitting in it that has no specified height.
I want to be able to grab the height of a specific table (ID="printIntro"). Firefox spits out a number, but IE regardless of version spits out a big fat 0.

from what i understood, IE should be able to understand offsetheight, no?
here's a snippet of a VERY simplified version of what .net generates, as you will see IE will return 0: Code:

View 8 Replies View Related

Setting A Cookie So The Welcome Box Displays Only ONCE?

Jun 2, 2009

I am working with the "sexy alert box" found here [URL] and have the code below, which pops up the sexy alert box on every page load.

<script type="text/javascript">
function test() {
Sexy.alert('Hello world!');
}
window.onload=test;
</script>

My problem is that I only want that code to show on the FIRST load for the user and every page after that it should not be showing. This will be the first time I've worked with cookies so I am a bit confused as to what to do with this code and where to edit things.

View 4 Replies View Related

If Button Displays, Add Breakline Below?

Nov 19, 2011

I have a page that has a hidden button at the top. When a link is clicked, the button shows. I want to write javascript so that if the button is showing, add a breakline below it and if it is not showing, do nothing. My attempt & fail is below.

<input type="button" id="listframes" value="Button" />
<script type="text/javascript">
//If the button is showing, then break line below it.. else do nothing[code].....

View 1 Replies View Related

Setting A Cookie So The Welcome Box Only Displays ONCE?

Jun 1, 2009

I am working with the "sexy alert box" found here and have the code below, which pops up the sexy alert box on every page load.

Code:

<script type="text/javascript">
function test() {
Sexy.alert('Hello world!');

[code]...

My problem is that I only want that code to show on the FIRST load for the user and every page after that it should not be showing.This will be the first time I've worked with cookies so I am a bit confused as to what to do with this code and where to edit things.

View 4 Replies View Related

How To Replace All Text Before It First Displays

Dec 18, 2007

We have web pages that are generated by another process. And we wish to change UPPER CASE text into Mixed Case. In effect, using JavaScript, BEFORE the page displays, I need to read all HTML that is in the BODY area - and then replace the text (after manipulating it to change various text to Mixed Case text). Do I use the OnLoad event - and what (approximately) would go into my routine?

View 5 Replies View Related

Pop Up Note Displays Off The Screen?

May 10, 2011

I have a link on my web pages that when hovered over displays some text in the form of a pop-up.However, some screens have a horizontal scroll on them, which means my pop-up has some text being displayed off the screen to the right.

[Code]...

View 4 Replies View Related

What Is URL Command That Displays Source Instead Of Page?

Jul 23, 2005

There's some command I forgot that you can type into the
address field of a web browser that will cause it to
display the source code for that page instead of
the page itself. Can anyone tell me what it is?
It's something like:

viewsource:http://mysite.com
or
view:http://mysite.com
or
source:http://mysite.com

except I don't quite have it correct.

View 1 Replies View Related

JQuery :: Define Where Text Displays?

Dec 5, 2011

urrently I'm using this for my 'form1':

<script type="text/javascript">
$(document).ready(function() {
$("#form1").validate( {

[code]....

View 1 Replies View Related

JQuery :: IE 9 (beta) Displays Error With 1.5.min.js

Feb 2, 2011

I'm not sure that this is a unsupported feature of IE 9 or something else.

While updating my code with newly released jQuery 1.5 IE 9 (beta) shows an error - SCRIPT438: Object doesn't support this property or method.

$(document).ready(function () {
$("<div><p>Hello</p></div>").appendTo("body");
});

View 2 Replies View Related

JQuery :: Displays A Message In IE And Firefox?

Feb 18, 2010

Someone might answer as I do to get the message I despligue IE or Firefox ".. a script is taking longer to run, want to stop or continue .. "(something like).this happens when I drive a system of more than 15000 rows around .. I am using this js

View 3 Replies View Related

Create Hover That Displays Webpage?

Mar 25, 2011

I am trying to create a hover that displays when text is passed over by the mouse using javaScript. The hover will display a URL to a detailed report when the user hovers over the text.

View 4 Replies View Related

Slideshow That Displays The 5 Images Randomly ?

Jan 20, 2011

I created a slideshow that displays the 5 images randomly. It is for a college project for a class I am in.

Here is the HTML for the area that holds the images

And here is the external .js file for it

I had the slideshow working completely fine... then when i finished the rest of the site and added more pages, it is now not working for me. It just sits at the original image that is loaded when they site loads.

View 1 Replies View Related

Program - Displays My Age On My Blog In The Format ?

Apr 9, 2011

I have previously copied and adapted Javascript examples from textbooks but yesterday I wrote my first program from scratch. The script basically displays my age on my blog in the format 'I am 20 years, 6 months and 12 days old.' The script automatically adjusts my age each day. I would love to receive some critique on my program; particularly on programming style, use of comments, and whether the code is generally well written.

Calculates the difference between the two dates, and convert into days

Calculating Years

Rounds years_old and years_old_r to the nearest whole number

Calculating Months

Calculating Days

View 8 Replies View Related

Can't Get It To Show The Other Form, It Only Hides Both Of Them And Displays Nothing?

Apr 5, 2010

i have two forms, one is to register and the other one is to log in. i want to have them on the same page, with the registration form displaying. And just allowing the user to click a link and show the log in form and hide the registration form.This is what i got so far, i can't get it to show the other form, it only hides both of them and displays nothing.

Code JavaScript:
<script type="text/javascript">
function toggleview(id) {
 var login = document.getElementById(id);[code].....

View 2 Replies View Related

Counts Down 10 Minutes And Displays It In The Top Corner?

Sep 3, 2010

I have a javascript script that counts down 10 minutes and displays it in the top corner. On the 10 minute time limit there is an event that directs the person to a page which logs them off.I am trying to create a 1 minute warning pop up alert window which I can get to work but the alert window itself halts the 10 minute countdown execution. Is there any ideas of getting the alert to sit outside of the execution of hte countdown. The script looks like this

Code:
// Take user here after session timed out
timedouturl = "index.php?doLogout=true";[code]......

View 2 Replies View Related

Dropdown That Displays Image And Url When Selected?

Nov 4, 2010

I am creating a page with a dropdown menu that has 140 countries in the list. When someone clicks on say, Algeria, an image of Algeria comes up below the dropdown with a URL below that. I got the code to accomplish that much. What I need further help on is how to make the URLs a hyperlink (all different) as well as making the image clickable so that a larger version pops up when clicked on. I'm ok with starting from scratch if there is a better way to accomplish this than what I've got. code...

View 3 Replies View Related

JQuery :: The Last Image Just Displays In It's Own Window?

Mar 20, 2011

Fancybox (Lightbox) - Last image not working. This is a follow on from another problem I had with the same image gallery I have this simple gallery that loads images from an xml file and uses Fancybox [URL]..Everything is working but the last image is not working with fancybox. The last image just displays in it's own window. Can anyone see why the last image is not displaying with fancybox.

[Code]...

View 1 Replies View Related

Create Elements For Image Displays?

Mar 3, 2010

I'm trying to use an ajax function to load filenames into a text area. This works and is not the problem.Then I read the contents of the text file and create an array of file images. The images can be .jpg, .gif, etc. Again no problem.However, when I try to create new <img ...> elements with a 'createElement' function, I get major errors. I think the problem is in the 'AddImage()' function in the code below.

Code:

<html>
<head>
<title>Image Display</title>

[code]...

View 3 Replies View Related

JQuery :: Cluetip Bug In IE7 - Browsers Title Displays?

Dec 6, 2007

I'm trying to use the Cluetip plugin to display data on mouseover ofthe tr tag. The data displayed is stored in the title attribute. Itworks great in FireFox, but in IE7 the browsers default title displaysalong with the Cluetip. Am I missing an option that would allowCluetip to override the browsers default title display?

$('tr.toolTipTitle').cluetip({
cluetipClass: 'jtip',
clickThrough: true, /* Set to true for allowing click to go through

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved