Having A Splitter (image Or A Line) Between Col1 And Col2

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


ADVERTISEMENT

Paste Splitter

Apr 12, 2005

<html>
<head>
<title>Paste Splitter v1.0</title>
<style type="text/css">
body, input {
font: normal 12px Verdana;
}
</style>
<script type="text/javascript">
/************************
Paste Splitter v1.0
Glenn G. Vergara
glenngv@yahoo.com
Philippines


NOTE:
Please make this intact
if you want to use this
script. Thanks.
*************************/

function PasteSplitter(origMaxlen){ //you can also pass as many field references as needed in the argument
var me = this;
var arglen = arguments.length;
this.flds = new Array();
this.maxlen = origMaxlen;
this.filter = this.NUMERIC; //default filter
for (var i=1; i<arglen; i++){
this.flds[i-1] = arguments[i];
}
if (this.flds.length > 0){
var fld1 = this.flds[0];
fld1.onkeydown = function(event){
extendMaxLength(me.flds, me.maxlen, event);
}
fld1.onkeyup = function(event){
splitPaste(me.flds, me.maxlen, event)
}
if (typeof fld1.onbeforepaste != "undefined"){
fld1.onbeforepaste = function(event){
extendMaxLength(me.flds, me.maxlen, event);
}
}
if (typeof fld1.onpaste != "undefined"){
fld1.onpaste = function(event){
//we need a little delay here before calling the function
setTimeout(function(){
splitPaste(me.flds, me.maxlen, event);
}, 10);
}
}
}

function extendMaxLength(arrFlds, maxlen1, evt){
if (!evt) evt = event;
if (evt.ctrlKey || evt.type=="beforepaste"){
var len = maxlen1;
var arrlen = arrFlds.length;
for (var i=1; i<arrlen; i++){
len += arrFlds[i].maxLength;
}
arrFlds[0].maxLength = len + arrlen - 1; //allow separators in beetween sets (e.g. - . /)
}
}

function splitPaste(arrFlds, maxlen1, evt){
var s = arrFlds[0].value;
//apply filter
switch (me.filter){
case me.NUMERIC:
s = s.replace(/D/g, "");
break;
case me.ALPHANUMERIC:
s = s.replace(/W/g, "");
break;
case me.ALPHA:
s = s.replace(/[^a-zA-Z]/g, "");
break;
default: //custom filter
s = s.replace(me.filter, "");
}
var len = s.length;
if (len <= maxlen1){
arrFlds[0].value = s;
if (arrFlds.length > 1 && len==maxlen1){
arrFlds[1].focus();
}
return;
}
else {
var len=0, start=0, arrlen=arrFlds.length, el;
for (var i=0; i<arrlen; i++){
el = arrFlds[i];
len = (i>0) ? el.maxLength:maxlen1;
el.value = s.substr(start, len);
if (el.value=="" || el.value.length < len){
el.focus();
el.value = el.value; //this trick puts cursor at the end of value after focusing on the field first
return;
}
start += len;
}
}
arrFlds[0].maxLength = maxlen1; //change back to original maxlength
}
}

//filters
PasteSplitter.prototype.NUMERIC = 1;
PasteSplitter.prototype.ALPHANUMERIC = 2;
PasteSplitter.prototype.ALPHA = 3;

PasteSplitter.prototype.setFilter = function(filter){ //custom filter (regexp) may be specified
this.filter = filter;
}
/***************end of script******************/



//SAMPLE USAGE
function init(){
var f = document.forms[0];

//serial number
var ser = new PasteSplitter(f.ser1.maxLength, f.ser1, f.ser2, f.ser3); //pass the original maxlength of the first field and all the references of as many fields as needed
ser.setFilter(ser.ALPHANUMERIC); //set filter to alpha-numeric

//sss number
var sss = new PasteSplitter(f.sss1.maxLength, f.sss1, f.sss2, f.sss3, f.sss4); //default filter (numeric) will be used
}
window.onload = init;
//END OF SAMPLE USAGE

</script>
</head>
<body>
<form>
<h1>Paste Splitter v1.0</h1>
<p>Copy any alpha, numeric or alphanumeric characters, even including separators such as slash (/), hyphen (-), dot (.) or anything, and then paste it in the first field. The characters will be split to all the fields automatically excluding the separator. Very useful for fields like serial number, Social Security number, telephone number and the like. The script works on the basis of the <code>maxlength</code> attribute of the field. It degrades well for JavaScript-disabled browsers, making the <code>maxlength</code> attribute untouched. It works well for IE for all paste commands (<code>CTRL+V</code>, <code>Edit->Paste</code>, <code>right-click->Paste</code>) and partially works for Firefox (<code>CTRL+V</code> only).</p>
<fieldset>
<legend>Information</legend>
<label for="ser1">Serial No.</label> <input type="text" maxlength="5" size="5" id="ser1" name="ser1" /> - <input type="text" maxlength="4" size="4" id="ser2" name="ser2" /> - <input type="text" maxlength="6" size="6" id="ser3" name="ser3" /><br />
<label for="sss1">SSS No.</label> <input type="text" maxlength="2" size="2" id="sss1" name="sss1" /> - <input type="text" maxlength="7" size="7" id="sss2" name="sss2" /> - <input type="text" maxlength="2" size="2" id="sss3" name="sss3" /> - <input type="text" maxlength="1" size="1" id="sss4" name="sss4" />
</fieldset>
</form>
</body>
</html>

If you have any comments, suggestion, bugs found, please feel free to post them here.

View 10 Replies View Related

JQuery :: Splitter Not Working Over Iframe?

Mar 14, 2009

I am using the jquery splitter from [URL]My right pane is fully occupied by an iframe. The splitter doesn't work when I try to drag it over the iframe (drag to right) i.e. the iframe does not resize when the splitter is dragged over it, but the same iframe resizes when the splitter is dragged over the left pane (drag to left). The iframe is contained in a div tag as shown in the html below.

<html>
<body>
<div id="left"></div>

[code]....

View 4 Replies View Related

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 View Related

.js File Contains A Line That Moves An Image Improperly?

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

Create A Simple In-line Image Swap

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

Image Disappears In IE8 When Expanding Multi-line Text Using CSS?

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

Make Cursor Go To The First Line Of The Form After Image Clicked?

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

Read Text File Line By Line And Separate Special Characters?

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

JQuery :: Get The First Line Offset Of Inline Elements With Multiple Line?

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

JQuery :: Reading File Line By Line?

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

Read Txt File Line By Line?

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

Moving Image - Foot Moving On The Red Line To The Room ?

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

Submit/return To Php When Moving From Table Line To Table Line?

Jan 13, 2011

I have a user that insists they have web applications that do this, and wants the one I'm building to do it too...

You have a table on an html form. As the user changes one or more fields in a table row and moves to the next line, the changed row should AUTOMATICALLY be sent back to the server and updated in the database.

If the user moves BACK to a line that's already been changed, and changed a field, a popup should display and ask "if the user really wants to change the field". If so, again, it should AUTOMATICALLY be sent to the server and updated in the database...

Ignoring the horridness of making that many round trips to the server and banging the database for every line, is there a way to AUTOMATICALLY do the equivalent of a submit and post the changed table row back to the php script?

View 3 Replies View Related

How To Put A New Line

Jun 14, 2010

I want to be able to put text on a new line in Javascript code. I tried '' but it did not work. My code for the java script and HTML is below. I want to put the Hours, Minutes, and Seconds all on separate lines.

Code:

<table border="1" cellpadding="5px" >
<th>Timer Amount</th>
<tr>

[code].....

View 14 Replies View Related

How To Delete The Last Line...

Jul 23, 2005

i use the following to add a line. how can i delete the last line?

oDiv = document.getElementById("MyDiv");
oDiv.innerHTML = oDiv.innerHTML + string;

View 1 Replies View Related

How To JScript Into One Line?

Jul 20, 2005

in ASP i can finish this line with an asp variable like below
mytext variable would contain a string like
"Pop_up()" <body Onload = <%=mytext%>>

so using ASP i can complete my onload statement.
I need a way to do this using a variable in Javascript.
How can this be done?

View 3 Replies View Related

Multiple Div On Same Line

Jun 11, 2009

i need to delvelop something like "SomeName X". Currently i am doing with DIV(1 DIV for 'SomeName' and 1 DIV for 'X' and finally float-left to another DIV). Since these names(like "Somename1 X",'Somename2 X")are populated in the div container, when it reaches the right end of the container, "X" alone getting wrapped to the next line. But it has to be along with 'SomeName' always. As other forums says, I tried with table but it didn't work since the final div container is fixed and i get multiple names with variant length. I tried clear: both, float left - it too didn't work. I have seen like the one in facebook - compose page.

View 1 Replies View Related

How To Move To A New Line

Mar 23, 2011

How do I change the <br /> tags in the follow code to javascript code that performs the same function. I need new lines where you see the <br /> tags and I can't use <br /> since my javascript is within the header section of my HTML file and the W3C validator doesn't like it. Therefore, how do I change the following code to pure javascript with no <br />'s. I tried using and but maybe I didn't use this right as it didn't work. Please help, I am new to javascript

txt="Name: "+name+"Sex: "+sex+"<br />Ethnicity: "+ethnicity+"<br />Region: "+region+"<br />Profession: "+profession+"<br />Membership_status: "+membership_status+"<br />Seeking: "+seeking+"<br />Education: "+education+"<br />Body Type: "+body_type+"<br />Eye Colour: "+eye_colour+"<br />Smoker: "+smoker+"<br />Drinker: "+drinker ;

View 1 Replies View Related

Get All Char From Each Line Of Div

May 26, 2011

Please help me to get all characters from every line from a word-wrapped div using javascript.Need to get all the characters for first line, second line, third line,... separately from the word-wrapped div.

View 2 Replies View Related

How Do I Add A Href Tag On Msg Line?

Mar 4, 2004

I'm trying to setup a daily tip section and would like to use href tags within my javascript message. I suppose this is possible, anybody have any suggestions?

This works without <a href>:
Code:
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
msg[1] = "Tip 1";
This doesn't:
Code:
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
msg[1] = "Tip<a href="tip1.htm">View More info</a> ";

View 2 Replies View Related

How To Insert A New Line

Mar 8, 2009

I have a autocomplete and I want that after a user selects the autocomplete, I want it to make a text input with the value of the autocomplete that is disabled in a new form so that they can submit it.What I have now:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

[code]....

View 2 Replies View Related

Line Drawing Library

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

Writeln And New Line () Not Working

Jan 20, 2006

I can get the escape character " " or document.writeln to give me a new line.
Or for that matter any of the form feed " f " or carriage return " " to work either.
I can get the escape character " " " I'm using XP home with SP2 with IE6 all my security setting set to Prompt so if that was an issue then at least I should get a prompt for allowing the
script to work. I put my JavaScript in a .js file and have referenced it from the HTML page.
I've tried this on different machines that also use XP with IE6, is this a problem with IE?

I've tried:

<script type= "text/javascript" src="assets/beagle.js">

..........

View 4 Replies View Related

Horizontal 2 Line Menu?

Mar 26, 2006

with the second line's contents selected by a mouseover the first line?

View 1 Replies View Related

Finding And Replacing A Line

Jun 4, 2006

Say I have some CSS, which is several hundred lines long, with the
contents in this format:

..foo {
blah
color:#000;
blah
}
..bar {
blah
color:#FFF;
}

where the selectors and their opening braces, their closing braces, and
declarations are each on their own lines (always), how can I replace a
specific declaration (line) given a unique selector and a declaration
property. For example, if I wanted the 'color' declaration property line
in the 'bar' class changed.

At the moment I'm iterating through the CSS one line at a time looking
for the selector and then looking for the declaration property (before I
hit the closing brace).

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved