JQuery :: Drawing A Line And/or A Box Over A BeforeAfter Image
Nov 19, 2011
We currently have a website that uses the .beforeAfter plugin to switch between two images. In addition we would like to add the possibility to draw a line and/or box using a boxer like option. All our attempts have been unsuccessful so far.
Could anyone tell us if and how it is possible to combine the .beforeAfter option with a drawing line/box one?
For curious users, here is the website we are currently working on:
[URL]
View 3 Replies
ADVERTISEMENT
Jul 23, 2005
Is there a small graphics library that I can use? All I need to do is
draw a line of a nominated thickness and colour between two specified
points and to, at some later time, "delete" the line?
I've found a few offerings but either they weren't multi-browser
compatible or they were too big for me to consider (20K instead of 2 or 3K).
View 8 Replies
View Related
Jul 2, 2009
I adapted Bresenham line drawing algorithm to draw a dashed line. I want to count the number of dashes. The dashes extend from one city on a map to another city. I don't want the dashes to obscure the city marker which is a small black dot, so I added some logic to skip dashes at the start of the line and at the end of the line. But this logic is confounding my attempt to count the dashes and I haven't been able to figure out why. The function should return the number of dashes as 'count'.
View 3 Replies
View Related
Jul 22, 2009
I am trying to design a system that allows users to draw on a whiteboard with different colors, save their drawing into hidden input boxes in the form on the page, then they can click Save Logo to save it to process it through PHP. I have the whiteboard that allows them to draw, but I am lost as to how to get the thing to populate the hidden input boxes.
So, I have the following code:
<HEAD>
</HEAD>
<BODY>
[code]....
What I am trying to do is use the function mousedown(e) to include an event to update a hidden input box with the value of the TD's background color that the hidden input field is attached to, so that it can be tracked when the user hits Save Logo at the bottom of the page. When they hit Save Logo, I want the form to post to itself, go through each of the input hidden fields and capture the color for each table cell, then generate an image based on the generated array, save it to a file on the server with the user's $_SESSION['userid'] as the filename + .jpg.
The problem is, though, that I do not know how to tell JavaScript to do this in the function mousedown(e) code. Also, look in the function table_create and see if I am naming the hidden input boxes correctly; not sure if it will generate the wanted result.
Just a note: I can handle all the PHP handling of the form, I just need help with the Javascript.
Edit: I attached the entire script/page to this post because so many functions rely on each other to operate, and I'm not exactly sure which function will need to be modified to get the desired result. Also, you can copy the code to a .php file to see what it looks like (as that may assist in demonstrating exactly what I'm trying to do, visually).
Edit 2: I suppose what I need to find is how to get the JavaScript to assign a value to the hidden input field that has the same id as the TD field that it needs to be linked to.
View 3 Replies
View Related
Feb 22, 2010
getting first line coordinates of multiple line inline element.
Example HTML
aaa bbb ccc ddd <span id="target">eee fff ggg
hhh iii jjj</span>kkk lll mmm nnn ooo ppp qqq
$(document).ready(function() {
[Code]....
Assume that span#target has a line break, when I see a browser. Then I click span#target, above function returns the head of coordinates which second line ("hhh") has. I want to have the coordinates which first line ("eee") has. How can I get that?
View 1 Replies
View Related
Jan 11, 2012
reading file in jQuery. Please if anyone knows how to write tome or to the website.
$.get("data/zelis.si.txt",function(data){
$.each(lines, function(n,line){
$.ajax({
[code]....
View 7 Replies
View Related
Dec 8, 2010
I want to create a drawing board in an html page were i can draw anything by dragging the mouse. and when i have done the drawing, i want to create an image of that drawing,
i found some examples doing this but so far all were using html 5, my requirement is to support most of the available browsers.
does anyone knows how i can do it.
i found one link which had what i required, [code]...
but in this the only problem is that if i drag my mouse faster, the draw line is discontinuous. i want it to be continuous free flowing colored pixels.
View 1 Replies
View Related
Dec 27, 2010
This is a question concerning the SVG plug in,Here is the code
<html>
<head>
<script language="javascript" type="text/javascript" src="jquery.js"></script>[code].....
1.SVG isn't drawing the circle
2. var svg is undefined keeps popping up.
View 2 Replies
View Related
Jun 15, 2011
I want to draw growing circles like a darts board and like attached picture using jQuery (I prefer) or another javascript library.
View 7 Replies
View Related
Jun 30, 2010
Hey everyone, I'm working on a website, and I have one page that uses a forum that is supplied by tal.ki.The forum works fine, but the .js file that the forum uses is grabbing the image that I am using as my header on the page (not in the header of the html, just on top of the page) and moves it down and right from where it is supposed to be. My apologizes for the file being so long, but I have no idea which line it is that makes the image move. If needed, I have pictures of how it looks in the program that I use, vs. how it looks when viewed in a browser.
if (!window.chatter) {
window.chatter = function() { return this; }();
}
[code]....
View 1 Replies
View Related
Sep 19, 2011
I'm new to Javascript and just trying to create a simple in-line image swap. Here is my code:
Code:
<SCRIPT LANGUAGE=JavaScript>
function swapImage() {
var image = document.getElementById("wordsearch")
image.src = "images/fall2011-wordsearchans.gif"
}
</SCRIPT>
[Code]....
The page displays but the image does not swap.
View 1 Replies
View Related
Jan 20, 2011
I have my page layout as below:
------------------
frame1
-------------------
****|******
[code]...
I would like to have a splitter (image or a line) between col1 and col2; When i click on it, It should display the cursor as =|= (something similar) and should be able to resize col1 and col2. (I have added * for understanding purpose to display them as separate columns)
View 3 Replies
View Related
Apr 8, 2011
I'm having trouble figuring out why my image is disappearing when the user clicks on the arrow image to expand text for viewing. The arrow image only disappears if the link text is is more than one line. It remains if the link is only one line of text. Here is the code:
[Code]...
View 1 Replies
View Related
Feb 2, 2011
Treat me like a novice on this question please. I may need to have someone do it for me if it's complicated.
What code would I need to insert in order to make the cursor go to the first line of a form (text box) when someone clicks on an image 410 x 162 px? I'm trying to accomplish this on the home page of e-workerscomp .net. There's a picture of the U.S. It needs to go to the first line of the form when clicked.
There's no need to make each individual state take the cursor somewhere.
View 2 Replies
View Related
May 25, 2010
how to read a text file using javascript line by line and separate from special characters in it. for example
Text.txt has
001203=Line one=abc.html
024353=Line two=xyz.html
092434=Line three=hjf.html
i want each column in an array like { 001203,024353,092434 } so total 3 arrays.
View 14 Replies
View Related
Aug 9, 2006
I heard or read that the next version of HTML will provide long-overdue drawing commands.
Which version of Firefox, Opera or IE supports such new fancy stuff?
View 7 Replies
View Related
Jul 23, 2005
I need to use javascript's graphics API to draw the letters of
the alphabet. If necessary, I can map out all 26 letters myself
and use drawline() to draw them, but I am hoping someone out
there might have a better suggestion. The user will click a spot
on the canvas, and the script will draw one of the letters at
that spot.
View 2 Replies
View Related
Jul 31, 2002
An interesting way of drawing a line interactively without the need for any plug-ins....
View 6 Replies
View Related
Oct 6, 2009
i want to let the user draw image or drawings on web page using html canvas element like stuff and then provide them to save that image or drawing on server so that next time they can get it as it was before to edit further.
View 1 Replies
View Related
Oct 21, 2009
I'm having a problem with the <CANVAS> element in JavaScript. here's what i'm trying to do: I need 3 different canvas elements for writing a signature to. they must all 3 be visible at the same time
My problem that i'm having is that i can't seem to get the code to work which will write to more than one canvas.
[Code]...
View 2 Replies
View Related
Mar 21, 2010
I am trying to create an Asteroids type game using JavaScript along with html5's canvas element for drawing. I have searched around and have looked at examples but I can't figure out what is wrong with my rendering that I do in the game loop that is run every frame. The problem appears to be only that the canvas is not cleared at the beginning of each frame but I feel there might be something wrong also. The code used and shown below only works in Firefox but not Google Chrome or Safari.
[Code]...
View 2 Replies
View Related
Oct 27, 2009
I'm trying to complete an application drawing of graphs or bar charts
I'm attempting to write a script that reads five numbers between 1 and 30.
For each number read, output XHTML text that displays a line containing that number of adjacent asterisks.
This is code I've come up with so far.
<?xml version = "1.0"encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-w3cDTD XHTML 1.0 StrictEN"
"http:www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http:www.w3.org/1999/xhtml">
[Code].....
View 1 Replies
View Related
Sep 30, 2009
I am working on an application where the user is able to draw using square images placed using absolute positions. The user can draw any shape but it must always be connected. I now need to work out the outline of the shape they created. The only information I have is the x y of the pictures that were placed. Its driving me crazy... I tried to work out a system of looping through all the pictures and seeing if there were any images touching.
My most recent idea was to make the javascript select the images and see if I could get the coordinates of the shape from there... In simple I need a way of merging the images into a shape rather than separate entities.
View 2 Replies
View Related
Oct 21, 2011
I've coded in Java before but I'm still having some trouble. I am trying to draw a ribbon type shape on an <canvas> element and for some reason, when I turned it into a function, it seemed not to work. Here is what I have for drawing the ribbon with a function:
function drawRibbon(height,width,Canvas){
var c=document.getElementById(Canvas);
var cxt=c.getContext("2d");
cxt.fillStyle="#bb0044";
cxt.beginPath();
cxt.moveTo(0,0);
cxt.lineTo(0,height-50);
cxt.lineTo((width-20)/2,height-100);
cxt.lineTo((width-20),height-50);
cxt.lineTo(width-20,0);
cxt.shadowOffsetX = 5;
cxt.shadowOffsetY = 10;
cxt.shadowBlur=10;
cxt.shadowColor = "black";
cxt.fill();
cxt.shadowOffsetX = 0;
cxt.shadowOffsetY = 0;
cxt.shadowBlur=0;
cxt.closePath();
cxt.beginPath();
cxt.strokeStyle = "#ffcc22";
for (i=5;i <= 135; i=i+15){
cxt.moveTo(5,i);
cxt.lineTo(5,i+5);
cxt.stroke();
}}
drawRibbon(200,120,navCanvas);
I feel like it has something either to do with the function definition, or the call. Before this script is executed, i create a canvas in the following way:
<canvas id="navCanvas" height="200" width="120">
Why it is not displaying.
View 3 Replies
View Related
Jul 7, 2010
How do I read a local text file line by line, one line at a time. I got upto opening a file, and can read whole file at a time. But I want to read just one line at a time. May be have a counter of lenght of the file and read only the counter number line at a time.
<SCRIPT language=JavaScript>
var fso = new ActiveXObject( 'Scripting.FileSystemObject' );
f = fso.OpenTextFile( "c:\mytextfile.txt", 1 );
[Code].....
View 2 Replies
View Related
Apr 25, 2011
I tried many ways to do it .. but didn't work any of them ..
The idea is move the foot to room no.1 .. but i want to see the foot moving on the red line to the room
like this pic : [url]
View 7 Replies
View Related