Hiding HTML Elements Without Using Javascript
Jan 17, 2006
Here's my situation:
1. I have a web browser component that does not support Javascript
(well it does, but we've disabled it)
2. I have to display some HTML in it, where the user has a link titled
"Hide|Show Options" that can hide/show a particular section of the
HTML.
I have not found a way to achieve it without using Javascript or any
other scripting language.
Is it possible to do this using pure plain HTML?
View 3 Replies
ADVERTISEMENT
Mar 30, 2010
I got a table with hundreds of rows...and I want the user to be able to hide a single one by clicking on the table row.
How can I do this without typing in hundreds of ids like 1,2,3,4,5... Since you can't get elements by class and ids have to unique I'm not sure how to do this. Also the order of the rows will change when they get updated so it would end up being a mess of unordered ids.
View 16 Replies
View Related
May 27, 2010
why I'm getting an uncaught exception with this?
var nav = "navigation";
$link = $("#" + nav + " ul ul");
$.each($link, function() {
[code]...
View 1 Replies
View Related
Jul 20, 2005
I am trying to hide a drop down box in a form on a jsp page using the:
style.visibility="hidden";
The form element is hidden ok but my problem is that the space still
exists where the element is.
Can anyone tell me how to hide these elements so that they dont mess up
the layout of my form.
View 1 Replies
View Related
Feb 13, 2010
I want to show or hide some tags of registration form with changing a combo
I wrote this code :
$('select[name=user_type]').change(function(){
FormType = $('select[name=user_type]').val();
switch (FormType)
{
case 'teacher': $('.teacher_form').show();
[Code]...
View 2 Replies
View Related
Aug 28, 2009
I'm having an interesting IE6 and IE7 issue that may just be par for the course. i'm curious if anyone else has run into this problem.
Here's the URL: [url]
I have a bunch of nested lists with IDs in certain ULs, like <ul id="collapse">. i'm trying to use jQuery .hide() to hide all the ULs with that specific ID. everything works as expected in firefox, safari, chrome, IE8, etc. but IE6 and IE7 seem to only notice the first UL in the DOM tree. so IE6/7 hides that first UL, then stops.
View 3 Replies
View Related
Jun 20, 2009
i've been searching the web for the best way to hide window elements in FireFox. But i'm not finding anything with clear defined answers.
View 1 Replies
View Related
Aug 16, 2010
If you want to see what I'm talking about at any point, go to [URL] and hit the "web" button in the top-rightish area. Or, you know, check the source code, because you can't see any of that stuff right now.
So, I'm working on a portfolio for myself. And I want to make it for myself, because, well, I don't want to be lame.
My portfolio has three parts: stuff I've designed on the web, stuff I've written, and other stuff. Those are separated by the three buttons in the top right. You hit one, and the old visible item fades out, and the new one fades in. It's pretty.
Now, the "web" section is the problem. Right now, the div associated with it contains 3 div's. Each of those divs contains a p, and is not visible by default. On ready, I do this:
function readyFunction()
{
var pages = [];
submenu();
[Code].....
But when I try it out, nothing shows. It should show the first element, right?
I am aware that by calling toArray(), I am turning jQuery objects into DOM objects. That's not the problem, is it? How would I fix that?
View 1 Replies
View Related
Apr 14, 2011
Let's say I have two lists for menus and one list for sortable content.
If I click on "A" in the #type list, the content list is sorted, the li's with the classes "B" and "D" are hidden by attaching a class of .hidden to display:none. In turn becoming:
My question is, how do I apply the new content results to the #location menu? If "B" and "D" are hidden then numbers "3" and "4" shouldn't be displayed. I'm having trouble getting the two to talk to each other. I've tried .is(':visible"), .each(), etc. and can't quite crack it.
View 1 Replies
View Related
Aug 8, 2010
I have some pages being loaded via ajax and I want some of the elements hidden when the page is loaded.I could hide them with CSS and then change the css attribute when I want them to show but that just seems clunky to me since I'd have to assign <input style="visibility: hidden;"> to everything I wanted hidden on load. I know how to make it visible later when I need it.Using jquery's document.read doesn't seem like a good solution either since I'd have to make a list of everything I might want hidden right there on the main page.
View 5 Replies
View Related
Jun 21, 2010
I am building a sort of tree view in javascript with items that can be expanded and collapsed (with default being collapsed).The problem is the page can get very large, and the user sees the the browser render the list with all the items expanded, and then sees them all collapse after half a second.[/quote]You could use a setInterval in the head section that's on a tight loop, that waits and watches for the tree, then hides it and removes the setInterval process.
View 2 Replies
View Related
Jun 15, 2006
I have a webpage where on the left side have a menu and on clicking the
different rows in the menu, different content needs to show up on the
right side. This all has to in a single web page. I suppose this can be
done using name anchors but would like to hide the rest of the content
and only show what is relevant depending on the row clicked.
View 2 Replies
View Related
Mar 30, 2007
If I have some XHTML that I want to transform into something else through JS (say I have a list of links to images and I want to transform it into a fancy JS-based slide-show), and I do this by calling some JS code in window.onload (in an external .js file).
The page starts loading, then the list is displayed, then once the whole page has been loaded the JS is processed, and the list is then turned into the fancy JS slide-show. The problem is, it's not very nice to *first* see the list, and then see it disappear and be substituted by something else by the JS. What would be the best way to hide the list?
I don't want to hide it with CSS because it should be visible for non JS but CSS capable agents. I came up with:
<ul id='foo'>
<script>
document.getElementById('foo').style.display = "none";
</script>
... the rest of the list follows
But I hate that script block. Any ideas?
View 16 Replies
View Related
Apr 8, 2007
<TR>
<TD>
<My for element with id=T100
</TD>
</TR>
what I really want is something like:
ParentOf (ParentOf (document.getElementByID("T100"))).display='none'
in other words "I like to hide the row" containing my form ele T100
Is this possible ? if so how?
View 1 Replies
View Related
Nov 4, 2006
I finally found code that actually works. I click on the button, and the table disappears. I click on the button again, and it reappears. Like magic! I have two problems still.
(1) When I click on the table, it disappears, but the space that it was in is still empty. When it retracts, I want the rest of the text to retract with it (not disappearing text--i.e. have the text occupy the space where the table was, and move back when the table reappears. note: the text is directly below the table); otherwise, what is the point of a show/hide button? It's meant to save some space.
(2) I want the text of the show/hide button to change to "Show" when the table is not present. Code:
View 5 Replies
View Related
Jun 3, 2010
I have HTML tags stored in XML. I want to be able to use these HTML elements with Javascript, just as you can with elements in document.body. How can it be done? (And don't try and tell me I should use server-side because I have written it all for Javascript and the project is nearly complete minus this and there are practical reasons for not doing this server-side. After all, anything is possible with Javascript!)
Let me explain:
- I have HTML templates such as this [URL]
- I want javascript to populate these templates then add them to my page
- The only way I know javascript can get this kind of data is by parsing XML
- I want to parse the XML then be able to use the HTML elements just like those in document.body
- As far as I'm aware, XML is the only good way of storing data for javascript. I don't want to store it in javascript variables (too much multiline data with " and '). Nor do I want to build it using document.createElement("div")... etc
As someone not yet with any experience in computer science etc, please ignore my poor terminology! However, I'm not a beginner when it comes to javascript.
Here's the script concerned but I doubt it'll help you understand my problem: [URL]
View 6 Replies
View Related
Jul 23, 2005
I would like to be able to display either one or the other HTML table
in the same place. I.e., there are 2 buttons on the screen. When the
user clicks one button, the table A is displayed below. When the user
clicks the other button, the table A disappears and the table B appears
in the same place.
When I use the classic div tags followed by table code, they are
displayed sequentially on the page, rather than in the same place.
View 1 Replies
View Related
Jul 2, 2009
Take a look at my testing website: [url]
You'll find the following javascript in the source code:
Now this all works...well, sorta.
The DIV elements specified are hidden when the page is first loaded.
These DIV elements then re-appear (as programmed above) when the mouse pointer is hovered over them.
These DIV elements are listed on the right-hand side of the test webiste.
They contain the Google Ad's you will see listed along the right-hand side of the website.
However, you were not suppose to see the Google Ad's when the website first loads up.
The DIV elements are initially hidden, but the Google Ad's contained in the DIV elements are always visible!
I want the Google Ad's to only appear if a mouse pointer happens to hover over them ( a little test of mine.)
I don't get it...the DIV elements disappears when appropriate, why not their contents: the Adsense?
View 3 Replies
View Related
Jan 30, 2010
I'm using the following css code which wrapped around a dynamically populated field;<span class="ui-widget-header platform ui-corner-all"></span>
When the span is empty I want to hide it, and I've used this jquery to do this.
However, the ui-widget-header class appears to be stopping it from hiding - if I remove this class it hides fine.
View 5 Replies
View Related
Jul 23, 2005
I'm working on some code and am running into brick walls. I'm trying
to write out Javascript with Javascript and I've read the clj Meta FAQ
and didn't see the answer, read many similar posts (with no luck
though), and searched through the IRT.ORG Faqs
(www.irt.org/script/script.htm).
The Javascript is designed to open an popup window and then inside that
window call another script which will resize that window. There may be
another way around this but the reason I tried this approach initially
was that I wanted to call the onload handler in the popup window to
resize the image only after the image had completely loaded. I've had
some code in the primary Javascript file (showimage.js) before that
works if the image has been cached but on the first load, it doesn't
resize properly which tells me it is probably because it is trying to
resize the window based on the image size but it isn't completely known
at that point. So I removed that code and tried placing the resizing
code in the second Javascript file (resizewindow.js). BTW I've tried
other code to open a popup image and automatically size it ie Q1443 at
irt.org but that doesn't do exactly what we need.
Even if there is another way to do this with one file, I still want to
figure out why this isn't working in case I run into it in the future.
I thought what I would need to do to use document.writeln to write
Javascript would be to escape any special characters and to break
apart the script tag ie
document.writeln('</SCRIPT>');
would become
document.writeln('</SCR' + 'IPT>');
I have a HTML page and 2 Javascript files. All files are in the same
directory and have permissions set correctly.
Here are the 3 files (keep in mind wordwrap has jacked up the
formatting):
index.html
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript1.1"
SRC="showimage.js">
</SCRIPT>
</head>
<body>
Click the house<BR>
<A ONCLICK="newWindow1('house1.jpg','Nice House')"><IMG
SRC="house1thumb.jpg"></A>
</body>
</html>
showimage.js
------------
function newWindow1(pic,sitename)
{
picWindow=window.open('','','width=25,height=25,sc rollbars=1,resizable=1');
picWindow.document.writeln('<html> <head>');
picWindow.document.writeln('<SCR' + 'IPT type="text/javascript"
LANGUAGE="JavaScript1.1" SRC="resizewindow.js"></SCR' + 'IPT>');
picWindow.document.writeln('</head>');
picWindow.document.writeln('<body onload="resizewindow();">');
picWindow.document.writeln('<img src=' + pic + '>');
picWindow.document.writeln('</body> </html>');
picWindow.document.close();
}
resizewindow.js
---------------
function resizewindow()
{
// Do resizing here.
// Right now this isn't being executed
alert("resizing window");
}
Can anyone provide some pointers as to why this javascript is failing?
I'm using IE6 on Win2k and when I click on the image to open the popup
window, it does open the window but it is white with no content and the
system immediately goes from about 4% CPU usage to 100% and
consistently stays there until I kill that window with the task
manager.
View 9 Replies
View Related
Apr 22, 2006
I have been trying to do the following. Using JS I want to create an
input element (text box) and attach a event listener. I have done in
in two different ways. The first is using xml elements directly (as in
e4x) and the second using the dom method createElement (which is much
clunkier to write). I'd prefer the former. I've included a stripped
down example below.
It appears that when creating an input element using the line:
var inputBox = <input type="text" size="30" />
that it does not have the same properties as when it is created with:
var inputBox2 = document.createElement("input");
because when an event listener is attached using addEventListener, an
error is generated on the first, but not the second.
My thoughts on this are either
1. The namespace for the input element is not correct and whether input
can have a listener attached. However, my guess is that it would not
show up in the first div box. Code:
View 4 Replies
View Related
Sep 2, 2010
check the following piece of code:
<html>
<head>
</head>
[code]....
I am trying to get <p id="p2">Test1</p> above <p id="p1">Test2</p> using javaScript only.
View 4 Replies
View Related
Oct 5, 2006
Is there a possibility to find out the coordinates, relative to the whole
screen, or at least relative to the browsewindow, where an element ( e.g. link or
picture ) begins or ends?
View 2 Replies
View Related
Nov 9, 2006
I'm looking for an alternate way to document.all to list all HTML-elements on a webpage.
I'm trying to get all IDs on a page that starts with specific letters,
ie: <div class='classname' id='MEIT_Start'.....
I wan't to build an array of items starting with 'MEIT_'
I have tried to use getElementByID but no succes...
View 2 Replies
View Related
May 11, 2010
This may be a repeat post, but I can't seem to find the answer in these forums. Here is the question: I have a div with id "someDiv". I am obtaining an HTML string via XHR and intend to insert it in the DIV. I use .html(theHtmlString) and it renders just fine. But the newly inserted elements are not in the DOM - either by name or id. How do I register them in jQuery?
View 2 Replies
View Related
Apr 7, 2009
Before the canvas tag you had to write a script to make a gradient for html element backgrounds. Now you can use canvas and it's as easy as ... well messing with canvas. I have this script. At one point I had the gradient img objects resizing so the gradient would not get skewed. it was simple. just set the height% at the opposite ratio of the canvas width/height. But I went to make some changes and the next thing i knew that no longer worked. I don't remember how I did it!! I'm going to have to start over if I can't figure it out. Here's the script. Canvas only.
I haven't adapted with excanvas for IE yet, but that's coming when I can figure out how I had the thing working right. It's a css issue. I had thought I put the img objects in divs that were sized and positioned and then set the images to width 100% height= 100%*((canvas.width-canvas.height)/canvas.width) So in my example, the canvas was 100 x 30 and the factor is 7 so it would resize the image 700% and the height would grow by the relative amount to the setting I had it. I'll try to figure it out, but there's the script working somewhat. I want to figure out a way to resize the img objects when the user resizes the page, but I want the img to always maintain aspect ratio. [URL]
<script>
/*ORIGINAL SCRIPT FOUND AT [URL]*/
window.onload = function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var g = ctx.createLinearGradient(0, 0, 100, 50);
g.addColorStop(0, 'rgba(255, 255, 0, 0.5)');
g.addColorStop(0.5, '#0ff');
g.addColorStop(1, '#00f');
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
var data = canvas.toDataURL();
document.getElementById('i').src = data;
document.getElementById('EIMG').src = data;
var canvas2 = document.getElementById('c2');
var ctx2 = canvas2.getContext('2d');
var g2 = ctx2.createLinearGradient(0, 0, 100, 50);
g2.addColorStop(0, 'rgba(255, 0, 255, 0.5)');
g2.addColorStop(0.5, '#0ff');
g2.addColorStop(1, '#00f');
ctx2.fillStyle = g2;
ctx2.fillRect(0, 0, 100, 50);
var data2 = canvas2.toDataURL();
document.getElementById('i2').src = data2;
document.getElementById('DIMG').src = data2; .....
View 3 Replies
View Related