Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up Word Definition on double click OR select/highlight

Status
Not open for further replies.
Have you checked their JS? Everything is in their JS file.

It seems they are using jquery to monitor the onmouseup event of the articlebody element. And then simply get the selection using window.getSelection or document.selection depending on the browser.

However their feature doesn't work in FF though it does in IE.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
3.6.12 too. When I double Click or even try to just select a word a nothing happens.

I get a bunch of CSS warnings, and a "COMSCORE is not defined" error in FF's error console. Not sure its related though.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
hi vacunita and billy, thanks for your inputs.

vacunita, i tested it in my firefox and it's working.

and....guys,

having looked at this page:

i managed to strip the necessary code that makes this 'select-popup-search' thingy work and i have this sample page below.

mypage.html
-----------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<script src=" type="text/javascript"></script>
<script type="text/javascript" language="JavaScript" src="<title>Google</title>
</head>
<body >
<div id="articleBody">
<p>
It was Google, in the odd dual role of both unwitting matchmaker and self-interested spoiler.
Google’s phenomenal rise, after all, prodded Microsoft, the dominant technology company for more than two </p>
<p>It was in the odd dual head role of both unwitting matchmaker and self-interested spoiler. </p>
<p>Google&#8217;s phenomenal rise, after all, prodded Microsoft, the dominant technology company for more than two decades, to court Yahoo. And Goog
</div>
</body>
</html>


i managed to save the script 'altClickToSearch.js' in my local machine but when i saved the 'common.js' to my local machine and linked to it, it doesnt seem to work, i.e. the popup is not showing. i tried all sorts but can't make it to work that's why i just left the original link( i want this file to be on my local machine.

any ideas guys?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top