Skip to content

Commit 7b75e1a

Browse files
committed
Merge pull request #34 from robertbosse/master
API Doc: Updated Example1 for hashtag
2 parents 491146a + 4891fa5 commit 7b75e1a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

entries/hashtag.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]]></code>
3131
</pre>
3232
<p>Click, and watch as the magic happens!
33-
<iframe src="/resources/hashtag/example1.html" style="width:100%;height:90px;border:0px"></iframe>
33+
<iframe id="hashtagIframe" src="/resources/hashtag/example1.html" style="width:100%;height:90px;border:0px"></iframe>
3434
</p>
3535
</longdesc>
3636
<added>1.0</added>

resources/hashtag/example1.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
</head>
4848
<body>
4949
<p id="nav">
50-
<a href="/resources/hashtag/example1.html#test1">test 1</a>
51-
<a href="/resources/hashtag/example1.html#test2">test 2</a>
52-
<a href="/resources/hashtag/example1.html#test3">test 3</a>
53-
<a href="/resources/hashtag/example1.html#test4">test 4</a>
50+
<a href="#test1" class="hashExLink">test 1</a>
51+
<a href="#test2" class="hashExLink">test 2</a>
52+
<a href="#test3" class="hashExLink">test 3</a>
53+
<a href="#test4" class="hashExLink">test 4</a>
5454
</p>
5555
<script>
5656
$(function(){
@@ -71,6 +71,11 @@
7171
// Since the event is only triggered when the hash changes, we need to trigger
7272
// the event now, to handle the hash the page may have loaded with.
7373
$(window).hashchange();
74+
75+
// To change src attribute of parent iframe element
76+
$(.hashExLink).on('click', function() {
77+
Top.document.getElementById('hashtagIframe').location.href='/resources/hashtag/example1.html' + $(this).href;
78+
});
7479
});
7580
</script>
7681
</body>

0 commit comments

Comments
 (0)