JQuery :: Possible To Trigger External Overlay Via EventListener?
Jul 9, 2010
I got the "loading external pages" overlay working just fine from the examples. My project calls for me to open an external overlay but we don't have control over the trigger point. The content is being injected into our pages via an external scripts. So I created an event listener with JQuery to listen for any clicks that occur to a specific link, this works just fine. What I've been struggling to do is open up an external overlay via my listener. I've tried creating a custom function called showOverlay that will do the real work but no luck. Is it possible to trigger an external Overlay via eventListener or do I have to take a different approach?
This is my eventListener.
$('#ExternalLinkReadID a').click(function() {
var id = $(this).attr('href');
alert("before: " + id);
$(this).showOverlay();
alert("after");
});
<a href="readreviews.jsp" rel="#overlay" style="text-decoration:none">
<button type="button">Reviews</button>
</a><!-- overlayed element -->
<div class="apple_overlay" id="overlay"><a class="close"></a>
<!-- the external content is loaded inside this tag -->
<div class="contentWrap"></div>
</div><!-- make all links with the 'rel' attribute open overlays -->
<script>
$.fn.showOverlay = function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[href]").overlay({
mask: 'lightgrey',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}});};
</script>
View 6 Replies
ADVERTISEMENT
Apr 11, 2011
I am trying to achieve a relatively simple effect but having a hard time. I have the code to swap the images displayed in a particular div with an external trigger but want to add a slide effect to the new images that loads upon activating the trigger. The code I have so far is:
<script type="text/javascript">
function changeBelt(beltName,BeltHolder)
{
var obj = document.getElementById(BeltHolder);
[Code].....
View 4 Replies
View Related
Sep 8, 2007
Can you see whats wrong with my code? I get the following error:
element has not properties.
function test()
{
document.getElementById("statusbar").innerHTML = this.id;
}
// Handles all elements
function init()
{
//var elm_right = document.getElementById("right");
var element = document.getElementById("left");
element.addEventListener('click', test, false);
}
window.onload=init();
View 4 Replies
View Related
Aug 1, 2009
I'm working on a drag and drop HTML editor, in which blocks can be positioned. I need to build a controller which listens to mouse events and takes appropriate action (a state machine). The system is built using prototypes and objects. The Controller class looks like this (I removed some methods for simplification):
Code JavaScript:
/**
* Creates a controller for a document
*/
function Controller() {[code]....
The method 'handleMove' is entitled to handle a mouse move on the overlay. Because the 'this' keyword would not point to the Controller object I've written a wrapper according to the W3C EventListener interface (http://www.w3.org/TR/DOM-Level-2-Eve...-EventListener). This wrapper holds a reference to the object in which the method resides that's handling the event, so that the important 'document' attribute can be reached. This document holds the document that is being edited (it's of a custom type, and not to be confused with the document as in document.body)
The problem I now have is as follows. IE doesn't seem to be able to work with event handlers following the EventListener interface, but just functions. I need to get the object's reference there as well though, but this can't be done using an anonymous function, as at the moment it will be run it will be in a different scope, and not be able to reach the controller any more.Just using a global holding that reference variable, a method I used before, is not sufficient, as there may be multiple instances of the editor running on the same page.I have no problems in FFox, Opera, and Safari. Just IE because it uses an alternative event listener model.
View 2 Replies
View Related
Nov 15, 2006
I've got to write some javascript to listen for a select 'change' event. Unfortunately, the select box has an onchange event as well. For example:
<select name="test" onchange="document.form.submit();">
Here's my event listener:
function handle_submit() {
return false;}
function addListeners() {
if (document.addEventListener) { document.form.test.addEventListener('change',handle_submit,false);
}}
window.onload = addListeners;
Now, the event listener does capture the event, but I want to cancel the onchange event within the select box. Is that possible?
View 1 Replies
View Related
Dec 2, 2010
I wanna implement a button that shows the context menu. I already implemented[URL].. I am now searching for hours about those 2 terms but have not found an answer yet. Also tried to trigger it myself but had no success yet.
View 1 Replies
View Related
Nov 1, 2009
I am building a new website which has some boxes that changes from classes(done with jquery magic ).I want to add an overlay(like the lightbox fading background) to the page when the user clicks on the switch button.I have tried a couple of things but it seems not to work:If tried to append a div to the body but that doesn't seems to work:
$(".nl").click(function(){
$("div.lang_english").fadeOut("fast", function() {
$(this).fadeIn("fast").removeClass("lang_english").addClass("lang_dutch");
[code]....
View 2 Replies
View Related
Apr 30, 2009
I have a PDF file that appears in an IFRAME. I use the ddsmoothmenu but the dropdowns will not overlay the PDF. I read I could use the bgiframe plugin to solve the problem, but so far have been unsuccessful…the PDF always appears on top. Does anyone have any experience using bgiframe to layer on top of a PDF in an IFRAME?
[Code]...
View 2 Replies
View Related
Dec 1, 2011
I have an overlay that is implemented using Malsup BlockUI, with a "close" button, however it won't close! - here's the details... I have a DIV that I use as an overlay:
<div id="mp" style="display: none; cursor: default">
<p>.....</p>
<ul><li>A</li><li>B</li></ul>
<div>
<span class="divbutton greenbutton mp_no" style="margin-right: 1em">not now thanks</span>
<span class="divbutton greenbutton" style="margin-right: 1em">
<asp:HyperLink ID="hypView" runat="server" style="text-decoration: none" NavigateUrl="~/mp.aspx">blah</asp:HyperLink>
</span></div>
</div>
Displayed using:
$.blockUI({ message: $("#mp").html() });
It has a cancel button (see above):
...
<span class="divbutton greenbutton mp_no" style="margin-right: 1em">not now thanks</span>
...
Which closes the overlay by means of :
$('.mp_no').click(function() {
alert("close overlay");
$.unblockUI();
return false;
});
However like I say, this simply refuses to close the overlay. I've used this same technique over and over again but this time something must be wrong. I just can't spot it! Moreover... if I place a button elsewhere on the page (and outside of the overlay DIV):
<span class="divbutton greenbutton mp_no" style="margin-right: 1em">not now thanks</span>
This will fire the click event, and is exactly the same "button" markup!
View 5 Replies
View Related
Jul 28, 2011
jQuery 1.6.2, jQuery UI 1.8.14. I use a sequence of dialogs to present a number of wizard type interfaces to my users, but I have a problem since upgrading to these jQuery versions that certain dialogs within each of my wizards open behind the dialog overlay and I can't get to it. I can see that the dialog is ending up with a zindex of 1000, and the overlay has a zindex of 1001, so I've overridden my dialog property to be 1002, and that brings it over the overlay, but then the input fields on the dialog are still not editable. The escape key will still close the dialog.
This doesn't happen to all my dialogs, but it does happen to the same ones in my sequence of dialogs each time, depending on which wizard I choose. I only see this problem with FF 3.6 (haven't been able to try newer ones yet), but things work fine in IE 8.
View 1 Replies
View Related
Sep 17, 2009
I am a beginner in jquery and search for a solution to display a overlay-Window. (ModalDialog, ModalPopup). I found the jdialog-extension: [uRL]. Looks very good, but I can't declare the overlay-content in a separate file. Instead I like to declare the overlay-content in the same page where it's called from. (asp.net-Eventhandlers etc). Is that possible or do you know another approach / another extension?
View 1 Replies
View Related
Oct 4, 2011
With the cycle plugin the image slideshow is pretty easy, but my problem is how do I show the text while "cycling" the images!so this is the code:
<div id="banner">
<?php print render($page['banner']); ?>
<!--slideshow-->
[code]....
View 4 Replies
View Related
Feb 6, 2011
I'm creating an overlay with multiple effects and clicks. To setup the overlay and the general effects(slide, fade, duration,.) there's no problem. As for some actions there's need an automated close after a few seconds.Here is my jQeury code for the total animation.
jQuery.noConflict();
jQuery(document).ready(function() {
// START DOCUMENT READY
[code]....
Now for what I want exactly to do: Create overlay if clicked on div in the body content. (DONE) Open the refering overlay of witch div container was clicked. (DONE) In my project there are 2 div's (as clickable items) with actions. For one of them the content with in the overlay moves to the right side and showes some other content. (DONE) If that last is done (click and move tot right) the overlay is suposed to close automaticly after a few seconds.
View 3 Replies
View Related
Jul 31, 2011
I'm new to jQuery, but I'm very excited to incorporate it into my project. I'm trying to re-create the following flash-based technique for an open-source medical student project, but I'm not sure how to begin: [URL]. The example is exactly what I am trying to achieve with jQuery. I have a fundoscopic image (image of the back part of the eye) and I want to put a dark overlay that covers the entire image except for a clear circular center, centered over the mouse cursor. The clear circular center should move with the mouse cursor (with some delay/smoothness). When the mouse cursor leaves the image space, the clear circular center should return to its initial position.
View 4 Replies
View Related
Aug 11, 2009
I use jQuery Tools and got a strange problem [URL]
HTML
<code class="html">
<button type="button" rel="#overlay" id="overlaystatic">static</
button>
[Code].....
does work in the function but not inside the jquery ajax.
View 2 Replies
View Related
Nov 2, 2010
Is there a window overlay that can load a text file with a scrollbar? I tried Chillbox but that only seems to load images.
View 1 Replies
View Related
Oct 21, 2011
I am using the cycle plugin to vertically scroll images with text overlays on a WordPress homepage. I position a div with a semi-transparentbackgroundto darken behind the text The div style uses abackground-image with the -moz-linear-gradient and for IE it uses filter with the microsoft gradient. I thought it might be a problem but it actually works half the time. When a new slide appears and scrolls down the text background is completely transparent - through to the page background. The text over the background is also faintly visible. Once the new slide is in position however, the background and textappear as intended. The suprising point -while theslide is being removed the text and background display perfectly.
[Code]...
View 2 Replies
View Related
Oct 3, 2009
I'm trying to add the lightbox plugin to a page and when the image is clicked the overlay and corresponding image are pushed to the bottom of the page wit the image below the overlay. The gallery div is nested inside a couple other divs and when the gallery images are clicked the overlay and lighbox divs are pushed to the bottom of the page instead of being absolutely positioned over the existing content. If anyone has some ideas on how to fix this I would like to hear them.
View 1 Replies
View Related
Aug 2, 2009
I have a DIV blocked from data entry in IE, Firefox, Safari and Opera. Functionally all is okay -- super plugin! The only problem left is that the cursor does not change to 'not-allowed' on the overlay when I use IE 6,7 or 8. All other browsers render the cursor okay?
Here's the code:
$().ready(function() {
Protect('#divData');
$('#cbProtected').bind('click', function(e, ui) {
if ($(this).is(':checked'))
Protect('#divData');
else
Unprotect('#divData');
});
});
function Protect(el) {
$(el).block({
message: null,
overlayCSS: {
backgroundColor: null,
opacity: 1.0,
cursor: 'not-allowed'
}});};
function Unprotect(el) {
$(el).unblock();
};
View 1 Replies
View Related
Jun 29, 2011
I have a div with content that i want to overlay over some other content. The tricky part is getting it to be full browser width and height. This doesn't seem possible in CSS, so I'm looking for a jquery solution. It will basically fade in when a button is clicked. I'm comfortable with the fading it in etc, but I'm just having trouble working out the full screen part - especially since I want it to stay full screen even on browser re-size.
View 2 Replies
View Related
Oct 16, 2011
I know nothing about javascript, but have found a useful code for enlarging images, and it would be great if I could just insert a line or two to get the overlay effect - so, what I want to add is a background when an image is open: for example - [url].
Here is the code
Code:
View 5 Replies
View Related
Aug 11, 2011
I have a page that has a list of companies pulled from a mysql db. Each company name is a link and when clicked an overlay comes up containing further details on that particular company.
Everything is working...my list is created, link pulls up the overlay, but as of now it only populates the info for the company that is the last record. I know I need to pass the record id to the jquery so that it pulls the record for the name clicked, but I am just not familiar enough with jquery to figure it out. I believe I need to pass it to a parameter, but need a nudge in the right direction. Below is my current code with just the basics, I have passed the unique id for each record via mid="<?php echo $member->member_id; ?>"> in the link...I just need to pass that to the overlay. code...
View 2 Replies
View Related
Dec 19, 2011
I want to create an overlay to show a photo in the middle of the screen with a navigation menu. As overlay I use something like:
.overlay {
position: absolute;
top: 0;
left: 0;
[Code].....
View 2 Replies
View Related
Jun 9, 2009
Example: [URL]facebook tab on the left). Is anyone aware of a jQuery plug-in that would do something similar?
View 5 Replies
View Related
Oct 25, 2010
I have a script that brings up an overlay box onclick that needs to be on top of everything else on page, however I can't get it to show on top of the navigation tabs. I tried calling the overlay script at the very beginning of the head section as well as tried to call it at the end but it doesn't seem to matter.
Is there something I can add to the script to force it on top of every other object on the page?
View 2 Replies
View Related
Jan 26, 2011
I currently want to implement an overlay and a dialog the same way its used for this sites login .
View 1 Replies
View Related