3 include
"../index.php";
5 $shell[
'title3'] =
"mouseoveroutside";
7 $shell[
'h2'] =
'Why mouse-over something, when you can mouse-over everything else?';
18 var elems = $(
'#test, #test div, #test .bind-me');
22 .bind(
'mouseover',
function(
event){
24 .removeClass(
'event-outside' )
25 .children(
'.event-target' )
28 .trigger(
'mouseover' );
31 elems.bind(
'mouseoveroutside',
function(
event){
33 target = $(
event.target),
36 text =
'Mouse-over: ' + target[0].tagName.toLowerCase()
37 + ( target.attr(
'id') ?
'#' + target.attr(
'id')
38 : target.attr(
'class') ?
'.' + target.attr(
'class').replace( / /g,
'.' )
43 .addClass(
'event-outside' )
44 .children(
'.event-target' )
50 $shell[
'script'] = ob_get_contents();
59 <script type=
"text/javascript" src=
"../../jquery.ba-outside-events.js"></script>
60 <script type=
"text/javascript" language=
"javascript">
67 SyntaxHighlighter.highlight();
72 <style type=
"text/css" title=
"text/css">
104 border: 2px solid #ccc;
108 color: #0a0 !important;
109 border-color: #0a0 !important;
110 background-color: #cfc !important;
115 display:
inline-block;
119 vertical-align: middle;
136 With <a href=
"http://benalman.com/projects/jquery-outside-events-plugin/">jQuery outside events</a> you can bind to an
event that will be triggered only when a specific
"originating" event occurs <em>outside</em> the element in question. For example, you can <a href=
"../clickoutside/">click outside</a>, <a href=
"../dblclickoutside/">
double-click outside</a>, <a href=
"../mouseoveroutside/">mouse-over outside</a>, <a href=
"../focusoutside/">focus outside</a> (and <a href=
"http://benalman.com/code/projects/jquery-outside-events/docs/files/jquery-ba-outside-events-js.html#Defaultoutsideevents">over ten
more</a>
default "outside" events).
139 You
get the idea, right?
142 <h2>The mouseoveroutside
event, bound to a few elements</h2>
144 <p>Just mouse around, and see
for yourself!</p>
147 test <span class="event-target"></span>
150 a <span class="event-target"></span>
152 b <span class="event-target"></span>
157 c <span class="event-target"></span>
158 <span
id=
"d" class=
"bind-me">d <span class="event-target"></span> </span>
159 <span
id=
"e" class=
"bind-me">e <span class="event-target"></span> </span>
163 f <span class="event-target"></span>
165 g <span class="event-target"></span>
166 <span
id=
"h" class=
"bind-me">h <span class="event-target"></span> </span>
167 <span
id=
"i" class=
"bind-me">i <span class="event-target"></span> </span>
174 <div
class=
"clear"></div>
176 <pre
class=
"brush:js">
177 <?= htmlspecialchars(
$shell[
'script'] ); ?>