Solved

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

Posted on 2011-03-08
6
894 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Bruce Smith
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:Bruce Smith
Bruce Smith earned 125 total points
ID: 35075519
This short article should alleviate your issue: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:Bruce Smith
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:
Bruce Smith 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery form 9 43
Text color and background in a text box. 2 26
CSS for <center> 14 35
Telerik RadEditor Control Save 8 20
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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