/    Sign up×
Community /Pin to ProfileBookmark

anchor using javascript

i am making a javascipt function to make show and hide, but i have a problem that i cant use this function by anchors.

<div id=”show2″ class=”show_span” style=”cursor:pointer; display:inline;” onclick=”showhidefn(‘doc2′,’show2’);[b][color=#800040]location.href=’#1′ [/color][/b] >

i need to make it using anchors. but the anchor is not working well wiz me using js.
can anyone help me to make the anchor using js?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 09.2009 — onclick="showhidefn('doc2','show2'); document.getElementById('a1').scrollInToView();"
Note that the id must begin with an alphabetic character.
Copy linkTweet thisAlerts:
@john_zakariaauthorFeb 11.2009 — onclick="showhidefn('doc2','show2'); document.getElementById('a1').scrollInToView();"
Note that the id must begin with an alphabetic character.[/QUOTE]



thnx alot for your reply

look,

i knew why i have this problem but till now u can not solve it ?

i am using a function for show/hide.. the data is hidden when page is loaded so there is a small data shown on the page (only titles) so when i press on any title to go to this anchor it did not work well bcoz of the existance of small data..

but when i made the hidden data [B] block[/B] i found that the anchor is working well..

i need the data to be hidden and also i need to use the anchor.. [B]how i can solve it????[/B]


thnx alot
Copy linkTweet thisAlerts:
@FangFeb 11.2009 — Could you give the full code or link.

Your code contains no anchor. Or are you referring to the bookmark?
×

Success!

Help @john_zakaria spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...