Solved

Lightbox (prototype.js) to open on right mouse click

Posted on 2011-03-08
6
885 Views
Last Modified: 2012-05-11
Hi,

jquery currently doesn't work on my website (conflict with existing script), so I need a lightbox (prototype.js I guess) script to be opened when someone uses the right mouse click on my website. This is to prevent users from copying image address - in lightbox there will be code how to embed particular image elsewhere (therefore the lightbox needs to support html).

I like this script: http://www.artviper.net/bumpbox-demo/index.html , however I don't know how to fire it on right mouse click.


Thanks
Tom
0
Comment
Question by:jhmplondon
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:patsmitty
ID: 35075146
...conflict with existing scripts...
What do you mean? Do you already have a jQuery plugin and you want to add another one? Are you using Joomla or something?

You can have as many jQuery plugins on one page that you want. You just have to make small mods. Post some code and I'll help you out.
0
 

Author Comment

by:jhmplondon
ID: 35075457
Nope, I have custom made website, but I think it uses prototype.js (not sure about it - can't see it anywhere included on the website).  If I inculde jquery library some parts of my website stop working like this star rating for example:

<div class="ratingRate" id="userRating">
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,1);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',1);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,2);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',2);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,3);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',3);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,4);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',4);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,5);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',5);"></a>
				</div>

Open in new window


I just know that once I include jquery in my page header, parts of my website stop working, so I can't use jQuery, therefore I'm looking for prototype/mootools lightbox which can be fired once someone presses right mouse button.
0
 
LVL 11

Assisted Solution

by:patsmitty
patsmitty earned 125 total points
ID: 35075519
This short article should alleviate your issue: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 11

Expert Comment

by:patsmitty
ID: 35075522
Basically, include the noConfilcts() call and use "jQuery" as opposed to "$" in you jQuery code.
0
 

Author Comment

by:jhmplondon
ID: 35075575
Ok, I didn't try it yet, however I'm surprised one can use these two libraries together! Thanks a lot. I'll try this solution.

Now how about to fire onclick action with jquery if someone presses only right mouse button over the element?
0
 
LVL 11

Accepted Solution

by:
patsmitty earned 125 total points
ID: 35075667
You'll have to add the something like the following after in the document.ready section:
 
$([selector]).mousedown(function(e) {
    if (e.which === 3) {
        // do your onclick action here...

    }
});

Open in new window

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
HTML button disabled 11 36
Hovering effect 9 29
Need sample Angular apps for study 4 33
while loop in html mail format 5 32
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now