/    Sign up×
Community /Pin to ProfileBookmark

highligthing div

Hi everyone. I’m trying for a while to make a div with a title and a list that is highlighted with rollover. I’ve made a graphic to exemplify what I’m trying to make.

[ATTACH]14129[/ATTACH]

I have tried to use the [URL=”http://newism.com.au/blog/post/58/bigtarget-js-increasing-the-size-of-clickable-targets/”]BigTarget.js[/URL] and the [URL=”http://www.trovster.com/lab/plugins/fitted/”]fitted.js [/URL] without any luck. Can anyone help me on this please?

Thanks

[upl-file uuid=514f1689-d27e-437b-99be-863fc07df15e size=80kB]highlighting.jpg[/upl-file]

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERMar 11.2011 — Most of this is just HTML & CSS with a dollop of JS.
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Hilite DIV &lt;/title&gt;
&lt;style type="text/css"&gt;
#div01 { height:300px; width:200px; background-Color:#f0f0f0; }
#div02 { background-Color:yellow; color:black; padding-left:20px; font-size:2em; }
#div01 li { list-style-type:none; padding-left:20px; }
#div01 li:hover { color:red; }
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
// For: http://www.webdeveloper.com/forum/showthread.php?p=1143401#post1143401

function $_(IDS) { return document.getElementById(IDS); }

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="div01"
onmouseover="$_('div02').style.color='red'" onmouseout="$_('div02').style.color='black'"&gt;
&lt;p&gt;&amp;nbsp;&lt;p&gt;
&lt;div id="div02"&gt; TITLE &lt;/div&gt;
&lt;li&gt;link01&lt;/li&gt;
&lt;li&gt;link02&lt;/li&gt;
&lt;li&gt;link03&lt;/li&gt;
&lt;li&gt;LIST&lt;/li&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@garretblakeauthorMar 12.2011 — Great! It's working fine ? thank you. How can I highlight the Title only when rollover a link instead of highlighting when the cursor is over the div?

thanks again
Copy linkTweet thisAlerts:
@JMRKERMar 12.2011 — Great! It's working fine ? thank you. How can I highlight the Title only when rollover a link instead of highlighting when the cursor is over the div?

thanks again[/QUOTE]

?

That's not what you specified in your original post with the jpg image (???)

Have the requirements changed after the code? :eek:
Copy linkTweet thisAlerts:
@garretblakeauthorMar 12.2011 — Sorry.You're right. After I've put all together I thought I could be best this other way.

But the code you've made it's great. thanks again
Copy linkTweet thisAlerts:
@JMRKERMar 12.2011 — Modified code ...
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt; Hilite DIV &lt;/title&gt;
&lt;style type="text/css"&gt;
#div00 { height:300px; width:200px; background-Color:#f0f0f0; }
#div01 { background-Color:yellow; color:black; padding-left:20px; font-size:2em; }
#div02 { color:black; font-size:1.5em; padding-left:20px; }
#div02 li { list-style-type:none; }
#div02 li:hover { color:red; }
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
// For: http://www.webdeveloper.com/forum/showthread.php?p=1143401#post1143401

function $_(IDS) { return document.getElementById(IDS); }

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="div00"&gt;
&lt;p&gt;&amp;nbsp;&lt;p&gt;
&lt;div id="div01" onmouseover="$_('div01').style.color='red'"
onmouseout="$_('div01').style.color='black'"&gt; TITLE &lt;/div&gt;
&lt;ul id="div02"&gt;
&lt;li&gt;link01&lt;/li&gt;
&lt;li&gt;link02&lt;/li&gt;
&lt;li&gt;link03&lt;/li&gt;
&lt;li&gt;LIST&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@garretblakeauthorMar 12.2011 — Thanks again.

I was referring to this:

[ATTACH]14133[/ATTACH]

Highlight the title only when rollover a link.

Cheers

[upl-file uuid=c94dcc90-6331-4fad-9a3e-3867c96a5e18 size=66kB]highlighting_01.jpg[/upl-file]
Copy linkTweet thisAlerts:
@JMRKERMar 12.2011 — Thanks again.

I was referring to this:

[ATTACH]14133[/ATTACH]

Highlight the title only when rollover a link.

Cheers[/QUOTE]


You changed the requirements again by changing the images!

Both look the same now, but they WERE different in your original post.

:eek:
×

Success!

Help @garretblake spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...