Hiding (X)HTML While Transforming It With JS

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


ADVERTISEMENT

JQuery :: Transforming Input As It's Typed?

Aug 12, 2009

My workplace has a lot of people doing manual entry. I'm looking to provide some friendly automatic formatting of data as they type it. I have working code (thus far) but I want to ensure I'm doing things in a sane way (there's a surprising amount you can do insanely that still works Here's a function below that transforms a phone number - the worker enters the digits(only), the field reflects (and could also accept) the fully formatted version (e.g. (123) 456-7890 ). I'm building this towards a plugin model (ala masked input with happy

[Code]...

View 3 Replies View Related

JQuery :: Transforming Json Into Object?

Aug 15, 2010

Do any of you know if you can convert a JSON object into a Jquery object ? The reason i wish to do that is to be able to use the jquery selector to filter my Json data. (for example filter them based on their properties)

View 8 Replies View Related

Hiding HTML Content ?

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

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 View Related

JQuery :: Transforming Change Function To Validator AddMethod Rule

Jul 12, 2010

I wrote this function to be a change event applied to a checkbox. Now it is apparent I need to use it as a custom validator method, so it runs when you hit "Next" to step through the form. I have all that working, I just can't get the syntax of the rule right.

Here it is as a change event:
$(
'#MKDPT'
).change(
function(){
if(
$(
'#MKDPT'
).is(
':checked'
)){
var
checked
=
false
; .....

And my attempt at a custom validation rule:
$
.
validator
.
addMethod (
"MKDPTOnly" ,
function (
value .....

I have tried several versions, but none is letting the form go to the next step (return true) if the conditions are met.

View 7 Replies View Related

Hiding And Displaying 2 HTML Tables In The Same Place With DHTML

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

JQuery :: Hiding Empty Span - Ui-widget-header Class Appears To Be Stopping It From Hiding

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

Hiding All Under Certain Div Tag?

Feb 21, 2011

I have hidden some parts of my menu, but I can't seem to hide the div tag.How do I accomplish this? This is my jquery:

$(function(){
$('ul.ldd_menu li.topLink ul').hide();
$('li.topLink').hover(function(){[code]....

It seems like my <div> class isn't getting hidden because if I do a border css, I can see the border lines.

View 4 Replies View Related

Hiding Divs

Jul 23, 2005

I have a page, which looks a bit like this:

....
<body>
<div ID=id1>................</DIV>
<div ID=gsd>................</DIV>
<div ID=ewd>................</DIV>
<div ID=fac>................</DIV>
<div ID=act>................</DIV>
</body>

I would like id1 to be visible at all times, but the other ids only to be
visible one if the time, using something like

<A HREF="#esf" onclick="showdiv('act')">

What would be the best way of doing this?

View 39 Replies View Related

Hiding A Div When Clicked Outside Of It?

Jun 1, 2009

i am trying to make a popup div which will close down after the user clicked outside of it now i am looking for a way to determine if the user clicked outside of the div or not

View 2 Replies View Related

Hiding Elements Without Ids?

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

Divs Hiding Under Each Other

Sep 25, 2010

I have this simple checkbox menu [URL]

If you check the cancer box a div will appear. If you check lung, another menu pops up. If you check colon nothing appears because it's behind the lung div. I am aware of z-index. But because a person may go back and forth between menus I need a way to make sure the appropriate div is always on top.

View 3 Replies View Related

Showing And Hiding Some Div?

Sep 29, 2010

i am having some problem showing and hiding some divi want to show the div with the id="universitiesDiv" on one point and the div id="highSchoolsDiv" on another depending on the user choice of selected option.

function Show (titleImg){
// the id of the content element from the id of the title element
var contentID = titleImg.id.replace (/title/, "content");

[code]....

View 11 Replies View Related

Hiding A Table Row?

Dec 30, 2010

Does anyone know the javascript to be able to have a table row collapse when there is no text in one cell, but there is text in the next cell? I have a 2-column table with titles in the left column and want the right column to be populated by a user. If the user doesn't populate the right cells or row, I'd like that row -including the constant/visible text that is in the left col- to be hidden and that row to collapse or move up... possible?

View 8 Replies View Related

Hiding A Table In NS4

Mar 29, 2004

I am trying to write a script that will hide a table in NS4. getElementById only works with IE4+ +NS 7 anyone go any idea how to adapt to function below to support NS4?

function hide(st)
{
document.getElementById("hide").style.display=st;

}

View 6 Replies View Related

Hiding A <div> In Explorer

Nov 9, 2007

is someone know a good way to show/hide a div in explorer as style.display do not work at all for me. I also try with visibility but then, it doesn't work in Firefox as I still see the scrollbar.

View 1 Replies View Related

Showing And Hiding Some Div

Sep 28, 2010

i am having some problem showing and hiding some div.i want to show the div with the id="universitiesDiv" on one point and the div id="highSchoolsDiv" on another depending on the user choice of selected option.

View 10 Replies View Related

Fun With Showing And Hiding Div's

Oct 30, 2010

I was wondering if anyone wanted to take a shot at re-factoring my code. I am not a javascript guru, and I would like some feedback on what I could do to make it better.The code shows/hides the top div, and when the top div is hidden, the bottom div takes up the space of the top div.

View 3 Replies View Related

Hiding A DIV By Clicking Anywhere

Mar 28, 2011

I found this code to Show/Hide a DIV. The great thing about it is that will hide the div by clicking anywhere outside the div, which this does.

However, how can I edit this to allow for multiple DIVs?

If you can't help with this particular code, Do you have another code solution I can use for individually showing many divs and then hiding them by clicking outside the div.

View 1 Replies View Related

Hiding A Div Onload?

Oct 8, 2009

I have some javascript that when a link is clicked hides the div and when it is clicked again shows the div... what I want to do is reverse that, so it is intially hidden. I have tried changing the display none to different parts but it always shows on load:

function toggleDiv (divid) {
if (document.getElementById (divid).style.display == 'none') {
document.getElementById (divid).style.display = 'block';[code].....

View 4 Replies View Related

Hiding OPTIONS In SELECT ?

Jul 23, 2005

Using IE5.5+, is it possible to hide options in a select?

The following doesn't work:

<HTML>
<HEAD>
<STYLE>
SELECT OPTION.orgA{ display:none }
.orgB{ display:inline }
.orgC{ display:none }
</STYLE>
</HEAD>
<BODY>
<SELECT id=cbo size=3>
<OPTION class="orgA">RTI</OPTION>
<OPTION class="orgB">LAB</OPTION>
<OPTION class="orgC">TCI</OPTION>
</SELECT>
</BODY>
</HTML>

View 1 Replies View Related

Hiding Boxes Dynamically In Ie

Jul 23, 2005

I've got 3 'alternative' boxes, only one of which I want displayed,
according to the value of an earlier select (so I'm using the
<htmlelement>.style property from javascript).

One is a div containing text, which I amend as appropriate with innerhtml
One is an image.
One is a div containing 4 input text boxes, which are disabled or not as
appropriate.

I've tried .style.visibility = "hidden" / "visible" (correctly leaves
blank space, which I don't want)
I've tried .style.display = "none" / "block" (works for moz, ie treats
as visibility)
I've tried setting .style.height & width to "0px" / null (doesn't work
for ie).

Any suggestions as to how to make the thing disappear and occupy no
space (dynamically) in ie as well as other browsers please ?

If anyone really needs to see the page, go to ccaweddingsdirect.co.uk/basket
login with chris at ccagroup co uk (you'll need to accept a cookie) -
the password is set to testz (it doesn't confer any great privilege,
just accesses my test shopping basket).
then click 'enter personalisation' for 4D01 (christmas card)
Select different wordings to change the bottom section - 10 and 'your
own wording' are the intereesting two, and orderpg.js is the js file.

View 4 Replies View Related

Hiding (not Closing) An Iframe From Self

Oct 21, 2005

I want to be able to hide an iframe but I need to be able to activate
this from the iframe itself.

This works most of the time but I it runs into issue when the domains
don't exactly match I get the following error in Firefox:

Error: uncaught exception: Permission denied to get propert
HTMLIFrameElement.style

I have tried:

document.defaultView.frameElement.style.display = 'none'

and

parent.document.getElementById('theIframeElement') .style.display='none'

Is there a work around?

View 1 Replies View Related

Hiding Table Rows

Mar 11, 2006

I'm getting an error in displayDirectors() on the line shown. What I
want to do is hide the rows in the table where rs_Board("DirStatus") =
"Retired" with hideDirectors() and show all records with
showDirectors(). What I did was create a column with a checkbox which
is not visible to the user and check this box when
rs_Board("DirStatus") = "Retired" and leave it unchecked when it
doesn't. There's probably a better way of doing this. I also want the
text in <span id="DirectorsCaption"> to change with each function but
I'm pretty sure this will work when the other error is debugged. Code:

View 1 Replies View Related

Hiding A Table Row Using Javascript

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







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