Setting Body Id?

Jul 18, 2007

Is there a small javascript snippet or something that can dynamically set the body ID on page load? I am using the Inverted Sliding Doors tabs from 456 Berea Street Code: but am trying to do so in a frameset [insert angry comments here] (I know I know, please don't harp!)... anyway, the tabs css sets the active tab using the body ID, but I can't seem to get it to recognize the body ID inside the frameset. Is there a javascript or some other code I could use to dynamically set the body ID? Or perhaps a better approach?

View 2 Replies


JQuery :: Tabs - Setting List To Display Depending On Class Of Body Tag?

Nov 6, 2011

I'm working on a site where we display two lists of boats, sail or power via the organic tabs plugin. Now, our client wants us to show one list type by default depending on the class of the body tag - for example, if the user was on a sailing boat page, the body would have a class of 'sailPage' and therefore the list that would be shown by default would be the 'sail list' - and vice versa for the power (although be default this one shows first anyways as it is the first 'panel' in the HTML') In my admittedly rather clumsy way, I've written the following jQuery function which does seem to work (well, the first half) - however when the user clicks back on to the 'power' tab whilst on page with a class of 'sail', the power list doesn't display. There also seems to be a problem in IE7 where the content of the lists will not display until you select the other tab first, and then select the second tab again?



View 3 Replies View Related

Make Body Content Scroll At The Same Time As An Iframe Located Within The Body?

Feb 21, 2011

I'm trying to make my body content scroll at the same time as an iframe located within the body. This has to do with the age old problem of mouse focus on iframes. When my mouse reaches the iframe and it takes over focus, I would like the body to keep scrolling until the iframe is right at the top of the screen. After that I want to relinquish focus to the iframe. I don't mind if the iframe starts scrolling as soon as the mouse reaches it, so long as the main body keeps scrolling for a while.

View 5 Replies View Related

Document Body X / Y Position - Style Document.body Not To Start At 0,0

Aug 19, 2010

It's possible to style document.body not to start at 0,0 for example: body {width: 1000px; margin-left: auto; margin-right: auto;} This means that X/Y of the body is not 0,0 but how can I find out what the position is using javascript? document.body.offsetLeft; is 0 and offsetParent is null yet if I position something absolutely at 0,0 it goes to 0,0 of the window, not the body!

View 2 Replies View Related

Onload Without <body> Tag?

Jul 23, 2005

I need to execute a JavaScript function "onload". The only problem is I
don not have access to the <body> tag as it is a part of the standard
page-header include (a separate file). How could I have certain pages
execute my function() onLoad?

The function basically just sets the original values of fields so that I
can determine if a field has been changed or not, which aleviates unnec.
sql update on the backend..

View 9 Replies View Related

Redisplaying The Body

Aug 10, 2006

How do you make a small change to the body of an html page from an event
handler? If you have a string var, a function that displays it in the
body, and a function that changes it, can you change the var on an event
and then reparse the body of the page but not the head? And if not,
then what?

View 4 Replies View Related

Body Background Every Day?

Feb 4, 2007

how to : another body background every day?

View 2 Replies View Related

Body Attributes...

Jul 20, 2005

Can someone tell me if there is a universal way to check the available
screen with and screen height for IE, Netscape, and Opera? Is there a
universal syntax?

View 5 Replies View Related

Accessing Body

Nov 23, 2006

I'm trying to figure out how to access body if it has no name or ID.


<p>example paragraph</p>

<style type="text/javascript">
document.getElementByTagName('body').setAttribute('bgcolor', '#000');

It didn't work. I also tried both of these:
document.getElementsByTagName('body').setAttribute('bgcolor', '#000');
document.getElementByTagName('body').item(0).setAttribute('bgcolor', '#000');

View 2 Replies View Related

GetData 'body'

Feb 7, 2007

here is the code :

| <a href="javascript: getData('demo.htm','body')" class="home">

now on the page demo.htm, the text will show on index.htm, or a picture (if I call it via img src), but if I have any javascript scripts it will show nothing--not even text. I know 'body' will give me the items/text in the body, but I assume body needs to be replaced with something else to get the srcipt to run. I just have no idea? Any options. I would like to keep the way the page is being calle dinto the frame, I just would like to add some functionality.

View 1 Replies View Related

Does Onload Always Have To Be In The <body> Tag?

Feb 9, 2008

Does onload always have to be in the <body> tag?

View 2 Replies View Related

Script At The End Of Body?

Nov 24, 2009

A lot of beginner JavaScript tutorials warn that we need to wait for the page to load (or at least the DOM) before we can interact with it. But that's exactly what we do when we put the script at the end of the body tag, as opposed to the head, correct?

View 9 Replies View Related

Hide Everything Outside Body?

Feb 25, 2010

How can i hide all from outside "<body" - "</body>" with javascript (with or without jQuery) ?

I need something just like jquery .hide() to hide every element that shows outside of "body" in page.

View 3 Replies View Related

Onload Outside Of BODY Tag?

Dec 30, 2003

I'm trying to get a popup working on my site. I use headers and was wondering if there is a way to put the onload outside of the BODY tag? My header has the BODY tag in it. I only want the popup to come up on one page and not all the pages that use my header.

View 2 Replies View Related

Body Onload

May 28, 2004

I have created a page that takes a person to another page automatically:


However, the script waits for the entire page to load before actually taking the person to the other page. What I need to do is to have a script that takes the visitor to the target page as soon as the page appears (without waiting for ads to load completely). How can this be done?

View 3 Replies View Related

Body OnLoad()

Jul 3, 2004

Just wondering if anyone knows if it's bad practice to put multiple body tags within one document? I'm using a template system (php) that loads template files into a main template (already containing a body onLoad()), and the content files also have a body onLoad() preloading functions intact. It seems to be working but wanted to know if there is anything wrong with this? What about broswer specific issues?

View 6 Replies View Related

Onload In The Body Tag?

Dec 20, 2001

How do you code two "onload's" in the body tag?

View 2 Replies View Related

2 Functions In A Body Tag

May 1, 2002

How would I call two functions in a body tag? Currently I have...

<body onload="init(); checkCookie();">

View 5 Replies View Related

Onload Even Outside Of The Body Tag?

Dec 18, 2002

I'm working in a template environment, and I can't change the <body onLoad> tag (it already had a muti-use function on it.

On the specific page I'm working on, I need some layer visibilities changed (dependant on a cookie) which seemingly can only can be done in the onLoad event.

so I need to add to or capture the onLoad for one page, and no others with a script included in the body data? (and of course it needs to be cross-broswer compliant 5+)

View 10 Replies View Related

How To Get The Height Of The Body

Feb 22, 2010

how can I get the height of the tag body? I mean...I'd like to obtain a value which describes (in pixel) the height of the whole body and not just the height of the window.

View 7 Replies View Related

How To Get Body Tag Style Value

Jun 17, 2011

I am trying to get the body tag style values.
<body style='width: 100%; position: relative; min-height: 100%; top: 0px;'>
I would like to get the text 'width: 100%; position: relative; min-height: 100%; top: 0px'

View 5 Replies View Related

Jul 23, 2005

The JavaScript underneath makes _one_ tab bold while the others receive
the 'none' CSS property. This works in a frameless page, and has
always worked. However, my current project _requires_ me to use frames
:-( (leftFrame, topFrame and mainFrame) and when I tested this script in
frames, it gave me a "invalid property" error. What can I do? Code:

View 1 Replies View Related

Is There Any Call Before 'body Onload'?

Jul 23, 2005

Is it possible to make a javascript call before "<body onload='...'>"?

What I'm doing is a preview of numerous images in an iframe and I want to
resize the iframe to match each picture. Normally I'd use the 'onload' (on
the src-page holding the image in the iframe) attrubute, but it's not called
until the picture has finished loading. I'd like to resize the iframe before
(or at the same time) the image starts loading.

View 2 Replies View Related

BODY OnBlur Event?

Jul 23, 2005

I'm having some trouble with the "onBlur" event in the BODY tag.
Ideally, what I want to happen is that when someone leaves window A,
window A executes a command. I had put

<body onBlur="savePage();">

I have a couple of problems. On IE 6 (win2000), whenever I put the
cursor focus on a textfield within window A, the "savePage" function
is invoked. And on Mozilla Filefox 0.9.1, the event never launches
even when I leave the window.

Does anyone know how I can solve these respective problems?

View 2 Replies View Related

What Is The Corrent Way To Get A Reference To The Body?

Oct 14, 2006

I've been doing this to get a reference to the body node of a document,
but I'm sure there must be something simpler than this:

var arrayOfBodyElements = document.getElementsByTagName("body");
var referenceToBodyNode = arrayOfBodyElements[0];

I tried:

var referenceToBodyNode = document.body;


var referenceToBodyNode = window.body;

both of which got me "body undefined".

So what is the right way to get a reference to the body?

View 1 Replies View Related

ContentEditable DIV & Document.body

Dec 7, 2006

Does a contentEditable DIV have the notion of an internal document? I'm trying to convert code that uses an IFrame.contentWindow.document to use the "document" inside a contentEditable DIV but they don't seem to be similar beasts. Eventually I want to add stylesheets to the contentEditable DIV as well as event handling. I'm porting an IFrame editor to a contentEditable DIV based editor.

View 1 Replies View Related

Copyrights 2005-15, All rights reserved