Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-19-2012, 04:47 PM   PM User | #1
m2244
Regular Coder

 
Join Date: Jun 2012
Posts: 129
Thanks: 1
Thanked 1 Time in 1 Post
m2244 is an unknown quantity at this point
Need help creating dynamic objects

OK, so I am trying to create a 'page scrubber' but I am not sure what to use.

In a nutshell, I plan on using JS and jQuery to read an XML file and count the number of pages listed in it. Then I want to populate a div with a number of 'tick marks' corresponding to the number of pages involved. These tick marks need to be something the user can hover which will display the page associated with that tick mark. Then if they click on it they can jump ahead to that page.

My question is, what should I use to created these tick marks? They will need to be small and evenly spaced. The number of these tick marks will vary.

Thanks in advance
m2244 is offline   Reply With Quote
Old 09-19-2012, 04:59 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
any html element can have an onclick and onmouseover event - it seems to me to depend on what you want the page to look like. The obvious candidates would be a span or button with a text content of an ascii code like & #10003 (closed up between the & and #) or an image tag

the coding for counting and laying out the ticks and adding their event listeners will be the same - it's pretty much up to you.
xelawho is offline   Reply With Quote
Old 09-19-2012, 05:14 PM   PM User | #3
m2244
Regular Coder

 
Join Date: Jun 2012
Posts: 129
Thanks: 1
Thanked 1 Time in 1 Post
m2244 is an unknown quantity at this point
Hey, thanks for the help again. I am trying to get my head around this. i don't understand this part of your comment.

Quote:
Originally Posted by xelawho View Post
...with a text content of an ascii code like & #10003 (closed up between the & and #) or an image tag
Can you explain this a bit?
m2244 is offline   Reply With Quote
Old 09-19-2012, 05:30 PM   PM User | #4
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
here is a list of some of the characters that html can render. Towards the bottom you will find check mark. Depending on if it were a span or a button, you would code it like this:
Code:
<span>& #10003;</span>
<button>& #10003;</button>
but without the space between the & and the # - if I write that here, this page renders it and you get ✓ which is what it will look like on your page

was that your question?
xelawho is offline   Reply With Quote
Old 09-19-2012, 06:16 PM   PM User | #5
m2244
Regular Coder

 
Join Date: Jun 2012
Posts: 129
Thanks: 1
Thanked 1 Time in 1 Post
m2244 is an unknown quantity at this point
I see what you're saying now. I haven't used special characters very often. Thanks very much.
m2244 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:17 PM.


Advertisement
Log in to turn off these ads.