Here's one I recently wrote that writes onclick to a draggable layer. You can write just about anything to it. It has a close box. You can have a border and a background color, or not. You can change the width and position from the link. Since there are 3 different ways of controlling the position (3 versions) and since it uses an external js file or two, I post a link.
This forum thread discusses the SitePoint article 'Re-Write a Layer's Content with Javascript' by Peter Todorov.
"How can you can replace the content of a Web page without additional requests to the server? The answer uses layers in JavaScript - Peter explains all."
I've tried the tutorials but I have never worked well with those -- I've always found it easier to actually be working with someone. But anyway. Basically, I need something sort of like this [URL] -- you click the thumbnail and the image appears in that predetermined spot. One thing, though: the images have to layer over each other. Like, you click image A, and it appears in the spot. You click image B, and it appears on top of image A. It'd be even better if when you clicked Image A it appeared and then you clicked image A again and it disappeared, but I'm going to try to start small.
I've gone through the tutorials and have a sort of ish understanding about what some of the parts of the codes do, and I've been told I'm a fast-ish learner, so I think I'll catch the hang of this quick.
Is it possible to have a draggable div that will only be draggable between certain coordinates? in other words create a window through which the draggable div is visible and draggable. Would you use a stop drag when cursor hits a certain point? my div is a map and will be about 2000px by 2000px and want to have a fixed position and size of 500px by 500px so that that is all the user will see or be able to interact with. I know in image slider plugins that the divs scroll to the side or up and down through what appears to be a window so it should be possible?
I have created a floating layer using Javascript that remains always on top of page on scrolling.Issue is,at some point while scrolling,the layer flickers continuously.
The html page is as follows:
Many common software systems, JavaScript has a history of security problems. Many of these problems could allow a person with malevolent intent to steal sensitive information from a visitor. The number and type of such holes in security vary among browsers and operating system versions. Most JavaScript security holes have been caught and fixed, but new ones are being discovered all the time. For a list of current security holes check out your browser's and operating system's Web pages. As a Web site author, it is your responsibility to keep up-to-date on the current status of known security holes in the applications you create.
Signing Scripts. In Chapter 11, I explained that JavaScript does not provide the ability to directly access files on the client computer. This can be a very large hurdle to overcome if you're trying to upload a file to a server from the client computer. Fortunately, file uploading is one of many functional enhancements that signed scripts provide. Signed scripts are specially packaged scripts that have been verified and signed to be correct and non-threatening. These scripts have additional rights on the client computer that allow a programmer to do many things that he wouldn't otherwise be able to.
With the introduction of Netscape 4.0, a new security model was put in place that would allow digitally signed scripts to bypass some of the restrictions that had previously been placed on them. A signed script can request expanded privileges from the visitor and, with the visitor's permission, gain access to restricted data. A signed script requests these additional permissions through LiveConnect, which allows your JavaScript code to communicate with the Java Capabilities API. The security model allows JavaScript to access certain classes in Java in order to extend its functionality while still maintaining tight security for the client.
A digital signature is a fingerprint of the original programmer, and it allows the security model of the browser to detect where (or from whom) it originated. A script signer can be a person or an organization. By signing a script, you acknowledge yourself as the author and accept responsibility for the program's actions. A signed script contains a cryptographic checksum, which is just a special value that ensures the signed script has not been changed. When a digital signature is detected, you are assured that the code has not been tampered with since the programmer signed it.
Once you finish writing a script, you can use the Netscape Signing Tool to digitally sign it. Signing a script does the following:
Unambiguously assigns ownership of the script to a person or organization.
Allows an HTML page to use multiple signed scripts.
Places the signed script into a Java Archive (JAR) file.
Places the source of the script in the JAR file.
Once a user confirms the origin of the script and is assured that it has not been tampered with since its signing, he or she can then decide whether to grant the privileges requested by the script based on the validated identity of the certificate owner and validated integrity of the script.
JAVASCRIPT FILE IS AS FOLLOWS:
AND CSS FILE IS AS FOLLOWS:
At some point while scrolling,the div 'movable' flickers continuously,while at some other point,it is perfectly stable.
I am totally new to jQuery and no good knowledge on javascript. However, I was assigned a task, to convert a javascript program to jQuery due to compatibility problem on browsers like Chrome and Safari. My program originally use javascript xmlDoc.load('....') to read XML file, and then use document.write statement to write html tables on client side. Something like this (the sample below may got lots of syntax problem as I jut want to show the major part):
Code: document.write('<TABLE >'); var y=x[0].getElementsByTagName('NoOfRows'); for (i=0; i<=noofrows-1 && i<=y.length-1; i++){ document.write(' <TD>'); document.write(z[j].getElementsByTagName('RecordDetails')[0].childNodes[0].nodeValue; }
Now I changed to use jQuery, I can read the XML file elements. However, when I try to write the table, it failed:
I have a client that has ads on her website that really slow down the site. These ads are called by an off site javascript file and I want to use a jQuery(document).ready or similar method to call these files after all of the site content has loaded. But these files contain document.write functions to add more javascript files. Since I want to load the files after everything else has loaded, this in turn makes the page blank and then loads the ad. Is there a way to position where document.write will write to?
I have a set of Div's which are all draggable, the coordinates of the div's are stored in a DB, so each time the page is reloaded the div's will have the same pos as they have when previous visitor left it.
There's one area on the page which uses the droppable function, when you place an div within the area the div, which is placed within the area. changes color.
My problem is that if a place a div in that area and then reload the page i find the div within the area but the div has the same color as if it would have when it's not located in the droppable area. In other words, It only changes color when I use the mouse to drag the div to the area not when it's positioned in the area with the coordinates from the DB.
I am trying to create some ajax/javascript to append the scriptaculous Draggable to a number of div elements with a className of draggable. The problem is i need to get the id's of each element to make them draggable, as simply making all div elements on the page draggable would effect other elements on the page which I dont want to be so.I need to:-
1.create a collection of div elements with className - draggable
2. make a list of all the element id's
3. make all elements with said id's draggable
I have left out the draggable part from the code, I have simply been trying to get the element id's to display so far
var dv; var dh;
dv = document.getElementsByTagName('div'); if (dv.className == 'draggable')[code].....
It works fine but I like to have the draggable div over the content div. I tried to set the position (in my css file) as "absolute" with "top: 1px" und "right: 1px" but then the div is no longer draggable. Also tried to set the z-index on 1 and 2 for the draggable div. It's not working..
On sorting out a drag&drop script. I'm a bit of a rookie with programming, so I found this script somewhere and I managed to implement it in my code...unfortunately now I need to slightly modify the code.
I have this drag&drop script that moves some images around the screen, but I'd like to assign an event - document.getElementById("XXXXX").onclick = blablabla - to each of those images.
The problem is that, of course, every time I click on the image to drag it around, this activates the link. With a doubleclick event everything works smooth, however it's a solution I don't quite like.
I was thinking about a way to control the code so that while the image moves the link is somehow "not active", but if the user simply clicks without dragging then it activates the .onclick function
I have the following piece of code in the head section of my page, which is the actual code for dragging the elements
In the above code i have a list of sortables, i want to add the draggable($obj) to a sortable, even though i add to the sortable in the add method, that gets added but does not play as a draggable,Do i need to call any method of sortable after adding the draggable ?
at the moment i work at a little "game" where the user of the website can drag arround divs. the function is
$ ( document )
[Code].....
and this works fine. the div containers contain transparent png images like circles, triangles an poligons are draggable by the user. but the whole div is draggable. it would be great if its possible to only drag the div arround while klicking on the image (triangle,...)
i have two div's that is drag'n'drop with[URL].. script for easy drag and drop. In div #1 i have a list of items that also is dragable and a list that is droppable in div #2 The problem is that if i move div #2 (also movable), the Jquery-code does not "know" that it moved and the droppable list is visualy in the right place but jquery thinks its in the upper left corner (where the start-place is), so i cant drop in the box. Making both divs movable
I want to use .css() to restyle list elements, I have 4 lists, they are connected. But I need to know where element dropped. I can read where it comes from with this code: ui.sender.attr('id') How can I know where it dropped?
This is the code if it's necessary; $(function() { $("#sol, #sag, #orta, #deaktif").sortable({ opacity: 0.6, connectWith: '.bagla', scroll: false, receive: function(event, ui) { var ComeID = ui.sender.attr('id'); alert(ComeID); //just for test }}).disableSelection(); });
Let's say I have two images. I make one dragable. I physically move one image directly over the other. While my mouse is pressed I release it. The image underneath recognizes and gives a message indicating it's covered by the other????
Is there some type of plugin available that can dynamically track and output x,y coordinates of a box I set using .draggable(). I'd like the coordinates to show inside the box as it is being dragged.[URL]...I wrote I simple scripts and I'd like to be able to drag any box I add and show the x,y coordinates inside of each one.
I'm not much of a programmer so I've difficulties getting the yellow windows at the following web address: [url] to drag and collapse correctly. Currently, the only window that works is the one with the red header. All the other windows should also be draggable and be allowed to close down.
So, basically I need to create the variable for this thing so that the nav windows work correctly. Problem is, everything I've tried has failed miserably to date.
I am attempting to create a floating draggable div, something very similar to all those rather annoying banner ads that have started to appear all over the net (dont ask it just has to be done) This code :
works perfectly (ish) in IE 6.0.2, but I have two and a half problems problems :
Problem 1 It renders correctly in Netscape 7.1 and Firefox 0.9.1 but I cannot get the click-drag-drop effect to work in these browsers.
Problem 2 A "move" cursor is displayed when the user mouseovers the title bar, if they click and drag you get a nasty flashing cursor effect as it transitions between a "move" and "pointer" icon. Can't say if this also happens in other browsers due to problem 1.
Problem Half How can I position this popup div so that it renders itself in the middle of the browser window? I spent some time looking at CSS positioning on w3c but didnt really find anything.
Can anybody point towards how I can solves these 2.5 problems?
While I am here, I had to "imaginer" a way of acheiving a cross browser compatible gradient effect for the boxes title bar. Basically I set a background image and tiled it. This is becuase there doesnt seem to be a Mozilla etc version of IE's "progid:DXImageTransform.Microsoft.Gradient...". Does anybody know if there is a better way of doing this?
EDIT : After some research/fiddling with Problem 1 it seems that the onmousedown event is not captured therefore the mousedown/move/up methods are not executed. This leads me to believe that the problem is rooted in this line :
I have a slight problem with IE, when everything works with firefox.
The goal is to _create_ boxes using the createElement method. And then making it draggable with the mouse. The code example below is still very temporary, but I could not get IE to drag the created box, when firefox does it without problem.
The drag n' drop is straight from brainjar.com. Since their code works for hidden/shown divs, I guess it all has to come from IE's lack of DOM support and problems with it and the used method? Is there any solution around this problem?
I'd really like to avoid turning boxes on/off (ie, block/hidden or visible/invisible) because the potential number of them being present in the future page can be enormous. The advantage of the createElement method is that it allows for light pages and a lot of client-side treatment....
I have a hyperlink that is draggable (using Prototype's "new Draggable()" construct). I want to be able to drag the link without actually 'clicking' the link once i end the drag. Is there a way to disable this event? Code: