Ok, so i have a few <div1> elements with static content inside of them. Then if you hover over the <div1> another <div2> pops up over top of it. (note: how this happens is the “display” property changes from “none” to “block”) This <div2> has data that is relevant to <div1>. It populates dynamically based on the <div1> that you over on.
These <div> elements i do not have access to manipulate. What i am trying to do is create a JQuery script that says if this particular data is populated into the <div2> than manipulate it in this way.
Could someone please help me with this? I would greatly appreciate it. Thanks!
If you have any questions or anything please let me know!
EDITED:
Ok, here is what i have… <div id="model-rotator-form"> is the div that stays hidden until you hover over an “li”, then it displays with dynamic content.
Within this <div> is an H2 element that holds the vehicle name, a UL element that holds two link images, and a bunch of other elements that i’m not trying to change.
The H2 element is <h2 class="model-name">Vehicle Name</h2> and the UL element is <ul class="link-btn"><li><a class="linkBtn" href="Model.aspx?d=711" id="model-rotator-link-1">Research</a></li><li><a class="linkBtn" href="/Dallas/For-Sale/New/Volkswagen/Jetta SportWagen/" id="model-rotator-link-2">Inventory</a></li></ul>
My code right now doesn’t work i know…this is just a reference point…
$('#model-rotator-form *');
if($('$h2.model-name').length() >= 25){
$('ul.link-btn').css('margin-top','-20px');
}
Let me know what i can do. Again…hope this code helps.
Now that a code sample is provide, I’m rewriting my original answer.
So something like this might work for you, in the function that pops the div (and has the popped div active in “this”) …
if ( $(this).find(“.model-name”).text().length > 25 )
$(this).find(“.link-button”).addClass(“whatever”);
The “whatever” class might have a negative margin that moves it a bit higher up. You’re getting into hard-coding territory here, though, where you’re making specific pixel decisions within the code, which is a bit scary