Resolved Autoscroll Div Up/down Loop?

Jun 22, 2010

What I'm trying to do just doesn't seem like it should be that difficult but I'm sure struggling with lacking skills I should say. I'm trying to automatically scroll a div up and down. For say if div.scrollTop = 0 then scroll to the bottom once it reaches the bottom scroll back up and so forth not stopping in a loop with say a timeout of 10.. Just need help putting it all together.

I've figured some stuff out:
I can tell if I'm at the bottom of the scrollable area with:
(document.getElementById(id).clientHeight + document.getElementById(id).scrollTop) - document.getElementById(id).scrollHeight

[Code]...

View 3 Replies


ADVERTISEMENT

Resolved Checking For Last Loop In Array

Feb 19, 2011

outputs lines of text, with two <br> between them. What I want is for if it's the last loop for that only to be one <br> but I can't figure out what that "last loop" code should be.

View 2 Replies View Related

Resolved Alert Result From For Loop

Dec 9, 2011

this is a homework project which kind of works but isn't perfect. My tutor said the result must be an alert but I ended up with a document.write instead.He said it was fine but I'd like to know how to make it alert the result if anyone can help.FWIW I tried making the contents of the for loop into a variable without success.

View 4 Replies View Related

Set Autoscroll Using Dyn-web?

Feb 15, 2010

On my page, I have a horizontal scroller which activates onMouseOver, I would like this to automatically start when teh page is loaded, when this reaches the end, it then scrolls the other way?!

demo:
http://www.dyn-web.com/code/scroll/horiz.php
JavaScript Code
http://www.dyn-web.com/code/scroll/js/dw_scroll.js

View 4 Replies View Related

Autoscroll Page Reloaded

Jul 8, 2006

What I want is when I submit my page the scroll position shows a specific area. I tried this but it didn't work(FF,OP6):mad:

<?php
if($_POST["submit"]){
print "<script type='' language='JavaScript'>
self.scrollTo(0, 100);
</script>";?>

<html>
<head>
<title>Untitled</title>
</head>

<body>

<form action="" method="POST" id="myForm">
<input type="submit" name="" value="Top" id="myButton">
</form>
<!--a lot of html code-->
</body>
</html>

View 1 Replies View Related

JQuery :: Make Autoscroll Stop At Bottom?

Jan 28, 2010

I've installed the jQuery autoscroll [URL], for my web page. I'm using it in a div tag for a news feed. The problem is that it is looping. Is there any way to make it stop at the bottom? And if its possible, is there any way to make it being able to scroll upwards again?

View 3 Replies View Related

Recursive Function With For Loop, For Loop Is Breaking When Calling Itself

Jan 22, 2011

I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together.

What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array.

What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created.

Here is the test object:

test = [
{
"name" : "Menu 1",
"url" : "menu1.html",
"submenu" : [

[Code].....

'Menu 2' and 'Menu 3' don't show up! I'm sure it's something small that I'm overlooking.

View 2 Replies View Related

Send A Loop Variable (i) To A Function Inside The Loop

Aug 4, 2011

I'm looking to send a loop variable (i) to a function inside the loop, but I can't seem to get it to use the value I want, it keeps making it a reference of i and therefore the function is always called using the last value of i rather than the one it was set with.

So if i have 5 Tabs then Tab 1, when clicked, should call DefaultTabClick(0) and so on rather than always using 4 for any of the tabs.

View 2 Replies View Related

JQuery :: Loop Forever And Reload Xml Each Loop?

Jul 29, 2011

I have the code below, how could it be modified to loop over and over and reload the xml file each time. Flow would be: load xml, run thruogh code to display each xml node one at a time, when reach last node, start all over, reloading xml file,

[Code]...

View 2 Replies View Related

While Loop Or For Loop For This Script Involving Arrays?

Mar 6, 2011

As you can see from the code and the output, it will attempt to write to the browser how many moves, but only '0'.

function rollDie()
{
return Math.floor(Math.random() * 6) + 1;
}
/*
*searches for a number in a number array.
*
*function takes two arguments[CODE]...

View 5 Replies View Related

Resolved Custom Pop Up Box

Aug 8, 2010

I am looking for a custom pop up box, but there is only 3 kinds (Alert, Confirm, Prompt). Neither of those will work.

View 13 Replies View Related

Resolved Change SelectedIndex IE Bug

Jun 19, 2009

why does this work under FF and only ONCE in IE but the problem remains the same as the firefox only code crashed IE's javascript.so it works only once still.SOLUTION -> changed event from onchange to onclick for my checkbox calling that function !

View 4 Replies View Related

Resolved Hiding A Div When Turned Off?

Dec 16, 2009

I am trying to make an order form I am working on accessible for users who have javascript turned off in their browser, and to do this I would like to hide a div if JS is disabled.

Searching the Web has led me to think that styling the div to not display is the way forward and then using JS to display it. It is the JS bit I am struggling with! The div in question is a set of radio buttons to allow a purchaser to choose how many gift memberships they want to buy:

<div id="giftmember-buttons" style="display:none";>
<h2 class="threepeaksform">How many gift memberships do you wish to purchase?</h2>
<fieldset class="threepeaksform">
<legend>Please select the number of people you are buying a gift membership for using the buttons below.</legend>
<div class="generalcontactform-group">

[Code]...

View 3 Replies View Related

Resolved Taking A Part Of All URL Value?

Mar 10, 2010

I have youtube link saved as a variable with value:[URL]... And I need to get a part of this link which I could use later:

The part would be oOzuBOefL8I It would be great to do it with javascript... Because I have url generated like this one:

httpObject.open("GET", "../talpinimas.php?id=reklama&paveikslelis="
+document.getElementById('paveikslelis').value+"&pavadinimas="
+document.getElementById('pavadinimas').value+"&url1="
+document.getElementById('url1').value+"&url1name="
+document.getElementById('url1name').value+"&komentaras="

[Code]...

View 9 Replies View Related

Resolved Get Value Check It And Do Something Conditional

Sep 13, 2011

I'm trying to create a test using Javascript. Actually, I did this in PHP, but we need to put it a server that does nor run it, I think I can convert it to Javascript. I hope it'll be work as in PHP somehow. Test will be composed of 15 questions and each question has either "Yes" or "No" as answer. And, I use radio buttons here for answers. By the way, there will be more than one radio groups. Now, I want to check the value of clicked radio button in each group and use an if-statement to determine if it's correct. And, if it's correct, I want to increment a variable by 1. Finally, by the resulted variable incremented for each question in the test, I want to use another if-statement to show specific result message for and interval of that variable.

[Code]...

View 4 Replies View Related

[RESOLVED] Toggle With Mouseover

Mar 11, 2011

I'm new to javascript, and i'm having a problem. I want a button, which functions as a toggle, but also as a mouseover. When you click, under the button, a div opens with text. And when you mouse over, a shadow appears behind the button.I have two pieces of javascript, but i want both in my button. Can anybody help me?

[URL]

View 1 Replies View Related

Resolved Trying To Add Watch Method To IE

Feb 28, 2009

I'm trying to add watch() to IE, and have more or less working code:[code]That works until I try to use setInterval with the code in red color. I never really tried OOP or prototyping in JS, so my whole approach to the problem might be wrong, but anyway, I think that if I execute that code in red every 100ms [for example], I'll be able to catch changes to properties on which the method is registered. Well, either my idea is wrong, or the execution.Some parts are commented out and method name is changed so that I could work in peace in FF.

View 3 Replies View Related

Resolved Need Lightbox With 3 Lines In Caption

Jun 5, 2009

I'm looking for a lightbox that allows me to have 3 lines of captions. Line one would be the art title, line two would be art dimensions, and line three would be media used. Would someone point me in the right direction? I have a lightbox that supports multiple lines, but doesn't allow for line breaks in the caption.

View 6 Replies View Related

Resolved Having Generating Random Text?

Aug 9, 2009

New to JS, and not too good at it. Trying to take some prewritten code and add script that displays some random text. Having trouble with assignment. Instructions are to replace a section of the file I am given with a script element. In the script element I am suppose to declare a variable named tipNum equal to a random integer between 1 and 10 returned by the randInt() function (which I made and have shown below). Then I am suppose to use a series of document.write() methods to write the following HTML code into the page:

<h1>Random Tip<br />title</h1>
<p>tip</p>

(Where "title" is the title of the random text as generated by the tipTitle() function from a external file, and which I did not make; and "tip" is the text of the random tip as genereated by the tipText() function, which is also from the external file, and not made by me) My code for the randInt() function is

function randInt(lower, upper) {
var size = ++(upper - lower);
var randValue = Math.floor(lower + size*Math.random());
}

The script I made to display the HTML code is

[Code]...

I am getting nothing on my page where the random text should be.

View 7 Replies View Related

Resolved Changing Site Style?

May 23, 2010

How can I use javascript to change the CSS the page uses? I'm a noob to javascript so please help me out =D

View 7 Replies View Related

Resolved Grouping Radio Buttons Within A Div?

Sep 22, 2010

I have a form with multiple Divs containing radios, text etc. What I'm trying to do is write a function that will validate all radios only within a specified Div (in the code example below, Div4). I need to validate if all the radios in the div have "no" selected, or button[1]. If any have yes selected, then nothing happens. Only if all have No selected do I need something to happen.

Assigning radios to groups for validation is something I've done on a global (all of form) scale, but I can't figure how to be explicit to a div. The code below works, but only on individual radios, not groups. I've included a few buttons outside the div for effect. Oh, and the final product won't have alerts, it will be used to trigger a hidden div elsewhere in the form.

[Code]...

View 7 Replies View Related

Resolved Newline From HTML Into Textarea

Nov 7, 2010

if I have this inside TD tag.what should I write instead ??? to reproduce new line in textarea.

View 2 Replies View Related

Resolved OnClick Sound For All Browsers?

Nov 11, 2010

I was wondering if there is a javascript code that works in all browsers and will allow when a person clicks on a certain tab I have that it plays a short beep.

View 3 Replies View Related

Resolved Enable Button Does Not Work In IE?

Nov 24, 2010

I have a form where I want to force users to accept terms and conditions before they can move on to the next page (submit form).

<input tabindex="2" name="agreement" id="agreement" type="checkbox" value="N" onchange="checkAgreement()" />
<label class="checking" for="agreement">I accept the <a tabindex="1" href="?page_id=292" title="read this before you continue" class="popmeup">terms and conditions</a>.</label>

[Code]....

View 2 Replies View Related

Resolved Change Radio Button Value

Nov 25, 2010

I want to change radio button values dependent on the selected item in a drop down list.The radio buttons have default values but I need them to be changed when the selection has been made in the drop down list and before the submit button has been pressed so the changed values will be written to the database.

View 2 Replies View Related

Resolved Accessing Local Data Using JS?

Jul 19, 2011

I am working on a project using HTML and javascript to allow the user to choose a vehicle from a drop down menu, then load a new page showing some information about this vehicle. The information is stored in an Excel file. I posted regarding this issue a while back and got an excellent response from Old Pedant about using ActiveX - which has thus far worked perfectly. My initial condition was that I would only be using IE7+. However, my next idea was to be able to use it on an IPad (which I unfortunately do not own yet, making any kind of testing difficult) which I am fairly certain ActiveX won't work on. So, I was looking for any other method which would be similar.

Important note: this will not use the internet at all, all of these files will be available locally. There is a lot of material on running queries to servers, but I didn't think that would really apply here. It seems pretty clear that JS has difficulty accessing files client side (which I understand why completely), but I was hoping to find something that worked for the gray zone I'm currently working in since I'm not using servers at all.

I know that this is not really the intended use of HTML/JS, but I was hoping that by writing it as an HTML file, it'd be accessible to anyone with a browser. Some of my target computers have odd limitations (such as not being to download .exe files).The code I based my original off of is shown below:

<script type="text/javascript">
var conn = new ActiveXObject("ADODB.Connection")
conn.Open ( 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:fullpath oMyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";)';
var sql = "SELECT * FROM [nameOfSheet$]";
var rs = conn.execute( sql )

[Code]...

View 1 Replies View Related







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