我觉得我的逻辑是有道理的;不幸的是,它没有:(?
更新:livecode
问题:
如何在 mouseenter 上抓取$(this).attr.('title')
并将该文本设置为('HGROUP h1')
's 文本?
jQuery
$("div.box").on('mouseenter', function () { //select the box create mouseenter function
var headerText = $(this).attr('title'); //get selected title and set to headerText
$('HGROUP h1').text(headerText); //set hgroupd h1 text to headerText
});
$("div.box").on('mouseleave', function () { //select the box create mouseleave function
$('HGROUP h1').text('DESIGNOBVIO.US'); //set the orginal text back in place on mouseleave
});
HTML
<div class="box">
<h1 title="can i haz it?2"></h1>
<div class="innerbox">
<figure></figure>
<ul class="categorySelect">
<li class="misc"></li>
<li class="print"></li>
<li class="video"></li>
<li class="web"></li>
</ul>
</div>
Hgroup HTML
<HGROUP>
<h1>designobvio.us</h1>
<h2>the colors duke, the colors!7</h2>
</HGROUP>
任何关于我哪里出错的进一步解释都会很棒。