Home > Tutorial > Jump to a Content Anywhere in a Page
Jump to a Content Anywhere in a Page
Posted on Tuesday, November 9, 2010 by android apps market for tablests
Here's another one. Have you ever wondered how to create a jump-to-content action when you click on something from a table of contents? For example, there maybe a list of links named alphabetically from 'A' to 'Z'. When you click on 'Y' for example, your browser will jump to the contents in 'Y', saving you from the trouble of scrolling down all the way towards the bottom of the page. Here's a simple example:
Before you get started, make sure your content is prepared. This includes your actual content as well as your table of contents (links that you expect your readers to click on). You can include 'Back to Top' text in your content to provide a jump back to your table of contents.
-------------------------------------------------------------------------------
Content for A
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Content for B
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Content for C
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Content for D
-------------------------------------------------------------------------------
Before you get started, make sure your content is prepared. This includes your actual content as well as your table of contents (links that you expect your readers to click on). You can include 'Back to Top' text in your content to provide a jump back to your table of contents.
Step 1:
Give your destination a unique ID. The destination can be anything: text, image, you name it. In the above example, I used texts as destinations. This is how you can do it. Click on Edit HTML, and find for the text that you want to be the destination of a jump. Then, give the text an ID. Let's say I want the text "Content for C" to be my destination. So all I have to do is give this text a unique ID. Say I want my unique ID for this destination to be 'ccontent', so I just have to add the ID as such:
You can make almost anything as your destination. For example, if you want an image to be your destination, just add an ID to it. So it'd look something like this:
Give your destination a unique ID. The destination can be anything: text, image, you name it. In the above example, I used texts as destinations. This is how you can do it. Click on Edit HTML, and find for the text that you want to be the destination of a jump. Then, give the text an ID. Let's say I want the text "Content for C" to be my destination. So all I have to do is give this text a unique ID. Say I want my unique ID for this destination to be 'ccontent', so I just have to add the ID as such:
<p id="ccontent">
Content for C
</p>
You can make almost anything as your destination. For example, if you want an image to be your destination, just add an ID to it. So it'd look something like this:
<div id="uniqueID" class="separator" <div id="uniqueID" class="separator" style="clear: both; text-align: center;">The only addition that I made to the code above is the line 'id="uniqueID"'. You get the idea. Give your destination a unique ID.
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitwdO5eZnBZKewHNm1CzzWvKWa9MgPiUavXrW3NZ0hbw9Seurj8p36HscJJ5FqewoR_iIGwb7bB9yzTgp27VapfEMbQ8qvSIta5csY4uSzH9LnXy7PCNTJ3jJQiHXJ9Wq9q5XryfDO7H7-/s1600/P1070106.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitwdO5eZnBZKewHNm1CzzWvKWa9MgPiUavXrW3NZ0hbw9Seurj8p36HscJJ5FqewoR_iIGwb7bB9yzTgp27VapfEMbQ8qvSIta5csY4uSzH9LnXy7PCNTJ3jJQiHXJ9Wq9q5XryfDO7H7-/s500/P1070106.JPG" width="500" />
</a></div>
Step 2:
All there is left to do is link your table of contents to the destination. Again, click on Edit HTML, find the text that you want to be the link for your jump, and link it to your destination. To link it, just use '#destionationID' as its address. In my case, when you click on 'C', you'd jump to 'Content of C'. This is how I did it. In Edit HTML, I find for this letter 'C', and I linked it, as such:
Again, emphasize on the target address. Use your destination unique id, prefixed with hash (#) as the target address. In the example above, my destination ID is 'ccontent'. So my target address is "#ccontent". To link an element, all you have to do is add a tag before your link, and another one after your link.
It's that easy! Do the same for your 'Back to Top' texts. Give your Table of Contents a unique ID, then go to your 'Back to Top' texts and link it to this unique ID. You can also link other elements like images in your blog to jump to a certain destination. Just link the image to the destination's unique ID. It is noteworthy that if you link something by just using a hash symbol, you'll jump to the very top of the page. Let me show you an example. In the text below, this is how I have tagged it in Edit HTML mode:
Go ahead and see what it does if you link something using the hash symbol only, without specifying any unique IDs. Before you jump to the top, let me say this. Do check my little advice below, and I hope this tutorial will be informative for you, and happy jumping!
All there is left to do is link your table of contents to the destination. Again, click on Edit HTML, find the text that you want to be the link for your jump, and link it to your destination. To link it, just use '#destionationID' as its address. In my case, when you click on 'C', you'd jump to 'Content of C'. This is how I did it. In Edit HTML, I find for this letter 'C', and I linked it, as such:
<a href="#ccontent">C</a>
Again, emphasize on the target address. Use your destination unique id, prefixed with hash (#) as the target address. In the example above, my destination ID is 'ccontent'. So my target address is "#ccontent". To link an element, all you have to do is add a tag before your link, and another one after your link.
It's that easy! Do the same for your 'Back to Top' texts. Give your Table of Contents a unique ID, then go to your 'Back to Top' texts and link it to this unique ID. You can also link other elements like images in your blog to jump to a certain destination. Just link the image to the destination's unique ID. It is noteworthy that if you link something by just using a hash symbol, you'll jump to the very top of the page. Let me show you an example. In the text below, this is how I have tagged it in Edit HTML mode:
<a href="#">Jump to the top!</a>
Go ahead and see what it does if you link something using the hash symbol only, without specifying any unique IDs. Before you jump to the top, let me say this. Do check my little advice below, and I hope this tutorial will be informative for you, and happy jumping!
Advice: It is always a good idea to publish your post first and get your link to the post before you include this jumping action. Why you may ask. Blogger's Post Editor acts in a funny way. After you have linked your text to your unique ID, Blogger's post editor sometimes will misinterpret this. So instead of being this:
<a href="#ccontent">C</a>Blogger changes it into this:
<a href="http://www.blogger.com/post-edit.g?blogID=1430937011014702882&postID=2984578751898596115#ccontent">C</a>This gives a false destination. It's a disaster. An easy fix to this problem is by adding your post's URL before the #. It will be more stable as Blogger's post editor will not misinterpret it.
<a href="http://southernspeakers.net/2010/11/jump-to-content-anywhere-in-page.html#ccontent">C</a>Then again, if you're using a custom domain, your page will/might refresh first before jumping to the intended destination. I am still linking directly to my IDs instead of adding my post's URL in front. As long as I don't toggle between Edit HTML mode and Compose mode often, my links will be fine (those uncanny numbers will not be added).
Category Article Tutorial
Powered by Blogger.
Blog Archive
-
▼
2010
(1682)
-
▼
November
(197)
- Info Product "T-Mobile Comet " 3G HSDPA Android P...
- Full Info Specification "Samsung A667 Evergreen" 3...
- Video: How To Hotpot
- Adding Buttons to Blogger Header
- Info Specification "Motorola MOTO MT716" Android S...
- New Info Product "Nexian Sound Box(Nexian NX-G509)...
- Namesake
- When Nature Pays A Visit
- iTunes won't backup iPad when syncing
- Info Specification about "Nokia C2-01" Handphone M...
- Info Specification Product "LG GS390 Prime" 3.0 in...
- No sound in apps since iOS 4.2 update
- Spirits for iPad
- How to Fix iPad No 3G service after 4.2 upgrade
- UNLOCKED DELL STREAK�S WITH NEW COLOR CHOICE AND ...
- APPLE IPAD ACASE SLIMLINE PREMIUM LEATHER CASE FOR...
- FUJITSU DISPLAYS A NEVER BEFORE SEEN 10-INCH WINDO...
- ACER UNVEILS SLIM AMD BASED WINDOWS 7 10-INCH TABL...
- ASUS U36 ULTRATHIN NOTEBOOK WITH CORE I3 & I5 13.3...
- iPad 2nd generation brings new features
- NETBOOK COMPAQ MINI CQ10-405DX AND CQ10-525DX
- TOP 10 BLACK FRIDAY WEB HOSTING DEALS
- Blogger Floating Footer
- T-mobile BOGO Promotion Now Begin
- Christmas Countdown Gadget
- How to get screen rotate lock switch back iPad iOS...
- Mail app crashes routinely on iOS 4.2.1
- iPad battery drains in sleep mode on iOS4.2
- iPad Notes only in landscape mode after upgrading ...
- Info Specification Product "T-Mobile Vibe E200" Ch...
- IOS 4.2 DIRECT DOWNLOAD LINKS LIST
- SONY PLAYSTATION PHONE SPECIFICATION
- Open Blogger Links in New Tabs
- How I�m Using Hotpot to Plan My Thanksgiving Weekend
- AirPrint - No Mail Print Icon but Safari and Photo...
- How to delete Game Center from iPad?
- MobileMe Account not verified with Find my iPad
- Product Info Specification Android Smartphone "Mot...
- Map Your Favorite Places Along the Macy�s Parade R...
- IDs and Classes for Beginners
- Remove Space between Blogger Posts
- Remove Space between Gadgets in Blogger Sidebar
- iPad stuck on cancelling sync
- AirPrint Setup on the iPad
- Most-Rated Google Places
- We Have Gone to SouthernSpeakers.net
- Music, Videos lost after iPad updated to iOS 4.2
- How Many iPad Apps and Folders Can I Have?
- How to Use AirPlay For Videos, Photos and Music
- Big Bad Sudoku Book - Game Center game
- iOS 4.2 AirPrint compatible printers
- iPad mute switch doesn't mute on iOS 4.2.1
- Lunch is on Google
- NEW TABLET ANDROID TOSHIBA FOLIO 100
- Siemens GreenTouchscreen� - Higher Education
- Nokia World's first ice touchscreen virtually burns
- Resize Blogger Post Image
- Update Apps Before updating to iOS 4.2 for iPad
- Trucks and Skulls HD
- iTunes Connect Mobile for iPad
- T-mobile 's "4G Sweepstakes" Contest
- HTC Released myTouch 4G Source Code
- Christmas Tale for iPad
- iPad crashes when scrolled through photos in iPhotos
- Hotpot's First Week
- Remove Blogger Static Page Titles
- How to get started with Game Center on iPad
- iOS 4.2 for iPad Release Date Delayed Again
- Info New Produk With Great Specs "LG L-03C" 12MP C...
- InFo Complete Specification Product "LG C320 InTou...
- Upload Multiple Pictures with Blogger's Updated Ed...
- Reposition Blogger Header Image
- Google Sky Map- now with time travel
- Google Sky Map- now with time travel
- Talking Gremlin HD - Entertainment app
- Running android OS on your iPad
- How to add PDF files to iBooks & read them on your...
- Info Complete Specification "Sony Ericsson Xperia...
- Information Product Specification CDMA Android Pho...
- AmazonWireless myTouch 4G Now Only $49 on Backordered
- Latest myTouch 4G Ad - Still Hits AT&T
- Editing your Google Docs on the go
- Editing your Google Docs on the go
- Info Product Specification "Samsung Nexus S (Samsu...
- review "ZTE Peel" Change Ipod Touch Into Iphone
- Introducing the Hotpot Blog
- Google Voice for iPhone
- Google Voice for iPhone
- Offline, meet online: a marketing experiment with ...
- Offline, meet online: a marketing experiment with ...
- Should I Upgrade iPad to iOS 4.2?
- EyeTV Enables Satellite TV on iPad running iOS 4.2
- Can't stop Mail checking email on iPad
- Android 2.3 Gingerbread Features
- Eric Schmidt teases Nexus S with Gingerbread
- Personally Yours on the Go - Personalized Recommen...
- Personally Yours on the Go - Personalized Recommen...
- Complete Info Specification of Android Phone "Dell...
- Review LG 4G Modem and Pantech UML290 VL600 4G W...
- Google Shopper 1.3 adds search filters and feature...
-
▼
November
(197)