This repository has been archived by the owner on May 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
109 lines (109 loc) · 4.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style type="text/css" media="screen">
body{
font-family:sans-serif;
font-size:13px;
}
a{
color:#ff0099;
}
pre{
background:#333;
border:1px solid #000;
color:#fff;
font-size:11px;
padding:9px;
}
.example{
border:1px solid #ccc;
float:left;
margin-right:18px;
margin-bottom:18px;
padding:0 18px;
}
.big-target-click-zone{
background:#f2f2f2;
}
.big-target-click-zone-hover{
background:#ddd;
cursor:pointer;
}
.big-target-anchor{
font-style:italic;
}
.custom-big-target-click-zone{
border-color:#aaa;
background-color:#ccc;
}
.custom-big-target-click-zone-hover{
background-color:#bbb;
cursor:pointer;
}
.custom-big-target-anchor-hover{
background:#fff;
margin:0 -5px;
padding:3px 5px;
}
.custom-big-target-anchor{
font-style:italic;
}
</style>
</head>
<body>
<h1>jquery-bigTarget.js v2.0</h1>
<p>jquery-bigTarget.js takes an anchor and expands it's clickzone by adding an onclick action to a parent element (defined in the clickzone plugin option) <a href="http://www.mezzoblue.com/archives/2004/08/19/fitts_law/" rel="external">improving user accessibility</a>.</p>
<h2>Plugin options:</h2>
<p>
<strong>clickZone</strong>: 'div:eq(0)' → parent element selector. The element will be the big target clickzone</br />
<strong>clickZoneClass</strong>: 'big-target-click-zone' → class added to the clickzone</br />
<strong>clickZoneHoverClass</strong>: 'big-target-click-zone-hover' → class add on clickzone hover</br />
<strong>anchorClass</strong>: 'big-target-anchor' → class added the the bigTarget anchor</br />
<strong>anchorHoverClass</strong>: 'big-target-anchor-hover' → class added the the bigTarget anchor on hover</br />
<strong>copyTitleToClickZone</strong> : true → copy the anchors title element to the clickzone</br />
<strong>openRelExternalInNewWindow</strong>: true → open rel="external" in a new window / tab</br />
</p>
<h2>Examples:</h2>
<div class="example">
<h3>No jquery-bigTarget.js</h3>
<p>
<a href="http://ee-garage.com" title="ee-garage.com">ee-garage.com</a><br />
<a href="http://newism.com.au" title="newism.com.au">newism.com.au</a><br />
<a href="http://leevigraham.com" rel="external" title="Open leevigraham.com in a new window" rel="external">leevigraham.com</a>
</p>
</div>
<div class="example" id="example1">
<h3>jquery-bigTarget.js Defaults</h3>
<p>
<a href="http://ee-garage.com" title="ee-garage.com">ee-garage.com</a><br />
<a href="http://newism.com.au" title="newism.com.au">newism.com.au</a><br />
<a href="http://leevigraham.com" rel="external" class="big-target-link" title="Open leevigraham.com in a new window" rel="external">leevigraham.com</a> <small> ← BigTarget Anchor</small>
</p>
<pre><code data-execute="true">$("#example1 .big-target-link").bigTarget();</code></pre>
</div>
<div class="example" id="example2">
<h3>Custom options</h3>
<p>
<a href="http://ee-garage.com" title="ee-garage.com">ee-garage.com</a><br />
<a href="http://newism.com.au" title="newism.com.au">newism.com.au</a><br />
<a href="http://leevigraham.com" rel="external" class="big-target-link" title="Open leevigraham.com in the current window" rel="external">leevigraham.com</a> <small> ← BigTarget Anchor</small>
</p>
<pre><code data-execute="true">$("#example2 .big-target-link").bigTarget({
clickZone: '#example2',
clickZoneClass: 'custom-big-target-click-zone',
clickZoneHoverClass: 'custom-big-target-click-zone-hover',
anchorClass: 'custom-big-target-anchor',
anchorHoverClass: 'custom-big-target-anchor-hover',
copyTitleToClickZone: false,
openRelExternalInNewWindow: false
});</code></pre>
<p>Tested in Safari, Firefox & Chrome.</p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery-bigTarget.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">eval(jQuery('code[data-execute=true]').text());</script>
</body>
</html>