LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2015, 11:49 PM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
HTML onClick problem


It would be nice if I could provide to a visitor a choice to either have a preview of a window content with "onMouseOver - onMouseOut" events or a view with "onClick" event in the navigation window of a site using "Frameset", I have the code below, the "onMouse.." events work but not the "onClick":

<A HREF="" onMouseOver="window.status='Explanation about `'Whatever.`'; parent.panl.location='u1/note/note_whatever.htm'; return true" onMouseOut="window.status='Splash page.'; parent.panl.location='splash_left.htm'; return true" onClick="parent.panl.location='u1/note/note_whatever.htm'">'Whatever.</A>

It makes no difference if the "onClick" is first or last.

Could anyone tell me what I am doing wrong?

Tank you for your help.
 
Old 06-20-2015, 01:01 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
I suggest if this element has "onclick" attribute then make it a <span> not an <a>
Code:
<span
    onmouseover="window.status='Explanation about `'Whatever.`'; parent.panl.location='u1/note/note_whatever.htm'; return true" 
    onmouseout="window.status='Splash page.'; parent.panl.location='splash_left.htm'; return true" 
    onclick="parent.panl.location='u1/note/note_whatever.htm'">
Whatever.</span>
PS: alway use [code] and [/code] tags when quoting code
 
1 members found this post helpful.
Old 06-20-2015, 04:15 AM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
I read somewhere that in an anchor tag (A=), the focus is lost unless you return false. Please change the second return true to return false and give us feedback.

OK
 
1 members found this post helpful.
Old 06-20-2015, 08:45 AM   #4
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you for your answers, neither solution makes a difference.

Code:
<span onMouseOver="window.status='Explanation about `Exit.`'; parent.panl.location='u1/not/note_exit.htm'; return true" onMouseOut="window.status='Splash page.'; parent.panl.location='splash_left.htm'; return true" onClick='top.panl.location="u1/not/note_exit.htm"'>Exit </span>
Code:
<A HREF="#" onMouseOver="window.status='Explanation about `Exit.`'; parent.panl.location='u1/not/note_exit.htm'; return true" onMouseOut="window.status='Splash page.'; parent.panl.location='splash_left.htm'; return false" onClick='top.panl.location="u1/not/note_exit.htm"'>Exit </A>
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML, form input onclick does not work mdooligan Programming 3 03-20-2015 11:05 AM
WGET javascript onclick delevel Linux - General 3 07-05-2011 06:28 AM
[SOLVED] HTML: Need a link (with onclick event) that goes absolutely nowhere cantab Programming 3 07-29-2010 08:57 AM
javascript onclick event nightmare ... plk Programming 4 10-15-2008 07:35 AM
onClick to return to the same part of HTML document rblampain Programming 2 02-29-2008 04:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration