JQuery :: Change An Element's Text Depending On Another Element's Display Property?

Apr 28, 2011

I'm doing a very simple expand/collapse function using 'slideToggle'. The button that triggers this event simply says 'Expand/collapse'. I want this text to change depending on whether an element is visible or hidden.

[Code]...

View 4 Replies


ADVERTISEMENT

JQuery :: Selecting Div Element Based On Display Property?

Dec 31, 2010

I am trying to select a div element based on its display property. Due to some reasons I can't use Id to select this element, DIV element is structured like this:

<div
class
="details"
id

[Code]....

View 1 Replies View Related

Get An Element's Display Property

Nov 20, 2007

How would I get an element's display property? For example, I can get the width by using the_element.offsetWidth, but what do I use for display?

I tried the_element.style.display, but it doesn't seem to work.

View 6 Replies View Related

JQuery :: Remove A Dd-element If The Dt-element In A Definition List Has A Specific Css-property?

May 17, 2010

i have got about 50 definition lists on one html-page witch all look linke this:

<dl>
<dt class="title">aaa</dt>
<dd class="subtitle">bbb</dd>
<dd class="city">ccc</dd>
<dd class="email">ddd</dd>
<dd class="website">eee</dd>
<dd class="description">fff</dd>
</dl>

if the dt-element in one of the definition lists has a specific css-property (e.g. length > 100px) then the dd-element with the css-class "subtitle" in the same definition list should be removed.

View 2 Replies View Related

Change CSS Property Of An Element Outside An Iframe?

Jan 18, 2010

how to change the css display property of a table, from hidden, to block outside of an iframe.

//This data is outside of the iframe
<style>
#table {display: hidden; z-index: 100;}
</style>

[Code]....

View 1 Replies View Related

JQuery :: Change The Text In One Element By Clicking On The Other?

May 22, 2010

I have this simple code and I am trying to change the text in one element by clicking on the other.

Relevent code shown:

<script type="text/javascript" language=javascript>
$(
'#A').click
(

[Code].....

View 2 Replies View Related

JQuery :: Changing An Option Element Into A Text Input Element?

Nov 18, 2011

Is this possible with JQuery? I have the following code which I think Should do this, but it's not working :/These are two different functions which I've been testing, and the html element is supposed to create a dropdown list via some PHP which will have the option "Other" within it. Unfortunately, I have no idea exactly how to turn "Other" into a text box when the user clicks, and I've been spending a lot of time on this already.

[Code]...

View 1 Replies View Related

JQuery :: Add Class To Element Depending On Anchor Of Page?

Jun 18, 2010

First, my url looks like this [url]...

I would like, depending on the value of the anchor called, to add a class to the box related.[code]...

View 14 Replies View Related

JQuery :: Showing A Random List Element Depending On It's Attribute's Value?

Mar 28, 2011

I have a page which contains an <ul> list with 5 items. Each of those items has a data-weight attribute which corresponds to its importance in the list. I have to make only one random list item appear and use the weight to make sure that the most important one shows up more often than the least important item.

View 1 Replies View Related

JQuery :: Way To Highlight Element Inside Parent Element / When Mouse Hovers Over Child Element?

Oct 4, 2010

i have a menu generated by a list with nested lists. i want the parent link to stay highlighted when the mouse hovers over the sub menus. because those sub menus are also generated by jquery (qtip), CSS alone won't do it (triedul.topnav li:hover a {background-color: #F00;}).is there a way to do this using jquery?

View 15 Replies View Related

JQuery :: Applying A CSS Property From One Element Over To Another

Mar 21, 2011

I'm trying to run a function that reads the css property of an element and copies it over to another element on click.

I'm sure a huge part of my problem is that I'm stillstrugglingto learn the correct syntax for things, but I'm sure it's framed like this:

I didn't want to post my ACTUAL attempt to code this, mostly out of shame. But I'm pretty certain that it's ridiculously incorrect.

View 2 Replies View Related

JQuery :: Checking For A CSS Property On An Element?

Aug 18, 2011

I would like to be able to test if an element already has a style applied to it. This style might either be an inline style, or come from a stylesheet. I'm writing a plugin which needs to apply a CSS style to an element if it's not already there.

View 1 Replies View Related

Document.getElementByID - Change The Text Of An Element

May 8, 2010

I want to use the document.getElementByID method to change the text of an element.

It works and replaces the old text but the new text is lower down when I want the new text to be on the same line.

View 1 Replies View Related

JQuery :: Retrieving OuterHeight Property Of An Element With An Image Tag (webkit)

May 11, 2011

I'm having an issue retrieving the height() / outerHeight() property of a div element that has an img as child. This happens only on chrome and safari. Here's an example: [URL]

View 1 Replies View Related

DOM Element Special Property Access?

Sep 21, 2010

I've been having this issue with Javascript that is just not getting resolved for a while. What I am basically doing is building a simple web browser extension that injects javascript on certain pages. I am using Firefox, Chrome and Safari. The issue I am having is accessing these so called "special properties" on a particular page. They look like the regular classNames, id, textContent and such but don't appear to be standard. It would be very helpful if I can access them.

A particular example would be in Yahoo Mail. When you are in your inbox you have list of messages. With each message row there are associated attributes. You can get to them with your web inspector or if you search for the div element with id "PagedTableView_wrapper", then follow the first child and then second child and you get a list of these messages being rendered. Each one of those rows has the regular className properties and such but also has "_checked", "_focused", "_selected" that look like custom Yahoo ones. I basically want to read those.

The issue is I can't. I always end up getting a null exception, as if it doesn't exist. I can read the className and the other standard ones fine, but not the special ones. (I've verified its the same element as well). I have tried the DOM navigation route with indexing, jQuery and XPATH, all with the same result. The weird part is that I can see them with the webInspector! Whats even more strange is that if I run firebug or commands in the Console, it actually works! But it doesn't work for my injected code/extension! Baffled.

View 1 Replies View Related

DOM Element.style.property Isn't Preloaded With CSS Values

Aug 5, 2011

I ended up having to preset style with JavaScript.

Here is what I did.

CSS Code:

JavaScript Code:

HTML4Strict Code:

The first time I hit toggle, nothing happens. The second time I hit toggle, the hidden list appears, but only because I used JavaScript to set the display property.

My workaround is to do this in the HTML after the element to be toggled.

JavaScript Code:

Putting this code in the elements onload event property didn't work either, which I found odd, but I read that it was not the recommended way of doing this.

I can't figure out why the CSS declaration didn't load into the JavaScript HTML DOM. I suspect it's some sort of order of execution thing, like the difference between the two following function declarations.

JavaScript Code:

View 2 Replies View Related

Element Onclick Property Function Not Work In IE

Dec 3, 2011

I'm writing a script that dynamically generates a menu table. Each TD has an onclick property which serves as a link. Everything works properly in other browsers since setAttribute onclick works. However, this function does not work in IE, and you're supposed to do this instead:
elementName.onClick = "blah";

Here's my code that works in all browsers but IE:
Code:
var truePath = "document.location.href=" + "'" + "/" + urls[i] + "'";
cell.setAttribute("onclick",truePath);
cell.onclick = truePath;

For IE, if I set the cell.onclick value to truePath, nothing happens when I click on the menu. However, it works fine in Firefox and Opera because of the setAttribute function. How I could get this to work in IE? My script is complete besides this part... I hate IE. Why can't they follow the rules?

View 5 Replies View Related

Store Some Custom Property In HTML Element Directly?

Jul 10, 2011

I want to store some custom property in HTML element directly, like this:

[Code]...

View 2 Replies View Related

JQuery :: Need Select The Highlighted Element (a) Depending Each "submenu" That Is Opened?

Sep 16, 2010

In This structure (see below), i need select the highlighted element (a) depending each "submenu" that is opened.

div#id > ul > li > ul.submenu
> li > a
> ul.class > li > a > ul.submenu

[code]....

View 5 Replies View Related

Change The Display Property Of Specific Divs Using Select Boxes

Feb 23, 2009

I'm attempting to change the display property of certain divs depending on the criteria of multiple select boxes.

I got it to work by GetElementsByTagName('div') but it then selects all divs rather then the select few i actually want it to work on. I tried changing the selection to GetElementsByName but this doesn't work, why i don't really know.

I've dumped the source code below:

Code:

View 4 Replies View Related

Change Text Depending On Condition?

Mar 10, 2009

I have the following code that I use to loop though records in my database and display the text. For each record I look through the text for a certain piece of text and then split the content it is found. So for example if the database contained a field with the data "this is some text [splithere] this is some more text" then the first part (this is some text) would be displayed and then a more button would be shown. If the user clicked the more button then the rest of the content (this is some more text) would also be shown.

At the moment the more button is always shown, even if the [splithere] text was not found. What I'd like to do is only show the more button where necessary. I'd also like to change the text from 'more' to 'hide' when the button has been clicked and the additional content is being shown as when they click the link again the text is in fact hidden and so saying 'more' doesn't make any sense.

Here is the code I use code...

View 14 Replies View Related

Toggle The Display Property To Populate A Div With Text

Jan 4, 2006

currently I have a page with six links. Now since I want to display the imformation on those six links (when each is clicked) in a #mainDiv (below all the links). if figured the most efficient way of doing so was to have all six "links" in six different div's -- all with display: none... and when a user clicks a link I just have the appropriate div set to display: block. Code:

View 38 Replies View Related

Change Text Within Paragraph Depending On Radio Button?

Mar 23, 2011

I have an electronics site on which I have a code generator. Im an stuck on how to acheive something.

I will simplify what I want to do, so I can then adapt it to my code. I have a paragraph of text on the web page, on which I want to change some words with in the paragraph depending on 2 radio buttons.

Example (radio buttons & short paragraph):

(Radio Button) Apples (checked) (Radio Button) Bananas "Welcome to jakes fruit shop. You have selected apples today" (apples being the word that would change if the banana radio button is checked)

Here is the code generator if your interested. [URL] What I actually want to do is put other 'fixed' text in the input text area (near botton of page) with only the config line changing.

And If I can be shown how to do the short example above, i think I will be able to edit my generator and get it to do what i want it to do.

View 6 Replies View Related

JQuery :: Display Specific Element In An Array?

Sep 11, 2011

I'm having problems selecting a specific index of an element in an array.

Here's the HTML code : (assuming there are 10 of them)

<div class="share-plus-container">
<span class="share-plus-link">Share [+]</span>
</div>
<div class="clear"></div>
<div class="right share-plus-box">

[Code]....

So the output that I should be expecting is that in an array of div's containing "share-plus-container" and its children, upon hovering the "Share [+]" link, it should display the "share-plus-box" div of that specific link.

View 6 Replies View Related

JQuery :: Display A Dynamic Created Element While Others Being Hidden?

Nov 29, 2011

I have a problem, I have a table which dynamically create <tr> elements with a unique numerical id, this is created on a while loop from a database statement, when I click on a hyperlink on each <tr> I use this:

[Code]...

So in this way, I'm sending the unique code (codigo) and I fadeToggle the <tr> identified with that specific id, it works, no problem, it display with one click, hides with another one, BUT, now I need that, when you click on a hyperlink, if any other <tr> is being displayed at the moment, close all of them, and open the clicked one, is there any way I can do this?

View 3 Replies View Related

JQuery :: Plug-in To Display (overlay) DIV Element On The Page At All Times?

Jun 9, 2009

Example: [URL]facebook tab on the left). Is anyone aware of a jQuery plug-in that would do something similar?

View 5 Replies View Related







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