Switch Content If Low Bandwidth
Sep 24, 2007
Is there a way where I can "guess" what relative speed the user's
connection is?
Currently, the client is wanting some graphical intensive content and
I'd like to be able to warn users on dial-up to allow them to go to a
"gracefully degraded" version.
I thought of simply putting up a question for users to answer but the
client would rather it happen, more or less, automatically.
View 7 Replies
ADVERTISEMENT
May 27, 2006
I've been driving myself crazy the past couple hours and can't figure this out. Here is what I need to do:
Have a select box like this:
<select name="dropdown">
<option value="option1">option1</option>
<option value="option2">option2</option>
</select>
Then when one of those options is selected, the appropriate div tag is displayed:
<div id="option1">
Div 1 Text
</div>
<div id="option2">
Div 2 Text
</div>
This seems like it should be really simple to do, but I can't figure it out.
View 5 Replies
View Related
Jun 15, 2011
im trying to have two links at the top of a page one is FEED and the other is INFO when the page opens it should be on feed, and if i click info it switches to info and the feed button becomes available to click again, at this time hte page content should switch as well.
View 6 Replies
View Related
Mar 12, 2011
Im creating a javascript content expander and would like to know how to create it so it changed the image from an down arrows to open the box, and a down arrow to close the box.Here is my current code.
Code:
<script type="text/javascript">
//var persistmenu="yes"
var persisttype="sitewide"
[code].....
I want the <div class="rightnews"> thing to change from an up arrow to a down arrow.Here are the icons im using.for the box to contract:
for the box to expand.
View 1 Replies
View Related
Jul 23, 2005
Does anyone have a good java script that I can add to my page so that the same user doesn't pound my site and use all of my bandwidth?
View 12 Replies
View Related
Jul 27, 2002
I found this on JavaScriptKit. It checks to see if the site accessing the data is your domain. I found it pretty cool.
//Beginning of "test.js" file
var accepted_domains=new Array("wsabstract.com","javascriptkit.com")
var domaincheck=document.location.href //retrieve the current URL of user browser
var accepted_ok=false //set acess to false by default
if (domaincheck.indexOf("http")!=-1){ //if this is a http request
for (r=0;r<accepted_domains.length;r++){
if (domaincheck.indexOf(accepted_domains[r])!=-1){ //if a match is found
accepted_ok=true //set access to true, and break out of loop
break
}
}
}
else
accepted_ok=true
if (!accepted_ok){
alert("You're not allowed to directly link to this .js file on our server!")
history.back(-1)
}
/////rest of your libray
"
"
"
View 1 Replies
View Related
Mar 7, 2003
What I'm doing is taking the parts of my web site that apear on every page, for example the tags from the first <html> tag to the <body> tag, and I just put some JS code into an external file that tells it to write that same code to the browser, then I call the external file where I had the original code.
That way the external file gets cached and they don't have to re-download that part of the code every time.
Combining this, with some other things including gzip I've been able to get my main index page down to 300 bytes, not including images, css files or js files, which are only downloaded once because of caching anyways(and they aren't that big in size themselves, either).
Of course this wouldn't work if you don't want to alienate people who don't use javascript, but 9/10 people do so for some this might be helpful...
Also, this still works with dynamic content as well. for example what I did for my main page where I display the news in little "news boxes" as I call them which are basicly divs setup so they look nice visually... what I did was make a function in the external JS file that accepts the different parts of the news box such as subject, body, time/date of post and who posted it, and then it creates the HTML for it. Then it's really easy to change the look of the displayed news by just changing the js file.
View 3 Replies
View Related
Jul 23, 2005
I need to know the min bandwidth for streming picture?
View 1 Replies
View Related
Mar 22, 2010
How would you go about writing a script to switch the style sheet if low bandwidth is detected? Is this even possible?
View 3 Replies
View Related
Jul 20, 2005
I'm trying to come up with a script and I'm having a heck of a time...
I require users to enter the size (in MB or KB) of the attachment they
wish to transfer/upload. As they enter the number and move over to
the next field (using onBlur or...), I would like a popup/alert window
warning them that this attachment size would take "x" amount of time
based on a speed of 24 kilobits per second (kbps). If they are happy
with the amount of time, I wish to allow them to click OK (to carry on
with the transfer) or Cancel/No to cancel it.
View 4 Replies
View Related
Jul 23, 2005
I have some function to Preload images and make MouseOver etc..
But when a put a Switch statement in one of my function (MouseOver), a
receive an error on body load in my preload function.. did someone have any
idea why ?
Here's my switch code :
function setOver(num)
{
var txt;
obj = eval('document.getElementById("image' + num + '")');
obj.src = imagesHover[num-1];
txt = '<img src="' + imagesInfo[num-1] + '">'
document.all("infoDiv").innerHTML=txt;
document.all["infoDiv"].style.display='block'
Switch (num)
{
Case 1: alert(num);Break;
Default: alert("hello");Break;
}
}
View 2 Replies
View Related
Mar 23, 2009
I'm trying to make an 'on' 'off' switch
the idea is for imgA to 'toggle' with imgB onMouseDown (onclick is used to call a function)
I can get the image to swap once but not back again. I have no idea if the way i'm attempting it is even close.
<script type="text/javascript">
function imgswap(){
if ( )
{
[Code]....
View 8 Replies
View Related
May 14, 2007
I'm trying to install a menu for my website. I am using a script I found here: http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm.
The code works great, but I would like to customize it slightly. Instead of being a vertical menu, I would like it to be a horizontal one, with all the main links at the top of the page, and with each link opening a horizontal sub menu beneath it.
I managed to create a horizontal list by changing the 'div' to 'span' and altering the HTML and CSS slightly. Now I have a horizontal menu that opens submenus when I click!
My only problem now is that instead of opening each submenu below all the links, it opens it below the link in question. So, for instance, let's say I have three links: Info, About, and Contact. If I click on 'About', it opens up a submenu under Info and About, and pushes Contact down to a new line below the submenu. If I then click on 'Info', it closes the previous submenu and opens a new one below Info, with About and Contact in a new line.
My JavaScript skills are pretty poor, so I was wondering if someone could help me identify where in the JavaScript I need to make changes so that the the submenus open below ALL the menu elements. Code:
View 2 Replies
View Related
Nov 1, 2005
This is my first time using the switch statement. I would appreciate your suggestion on how to do this properly. I am trying to get customer age which is (age) and compare it with the monthly rate then the text msg will display in the textarea. Also, I am having trouble figuring out how I can defined my monthlyRate in the switch or do I need to this outside of the switch? Code:
}
View 10 Replies
View Related
Feb 2, 2005
im looking for a nice javascript cde which switch css link href when browser is detected.
View 9 Replies
View Related
May 31, 2007
I am using a switch function to toggle those links for display and unlink image will be hidden. But I have just duplicated the first block of javascript for the second tab, it didn't work. This is the first block of switch function, it works for first tab: Code:
View 4 Replies
View Related
May 6, 2010
I'm trying to make a printable version of a webpage using the css @media tag. On the page is a javascript which works great for the on-screen version but I need to find a way to switch it off when printing as it hides content.
Beyond building a separate page I can't think of anything obvious!
View 1 Replies
View Related
Jul 23, 2005
As I can remember this is not allowed in Java:
int x, y, z;
switch(x,y,z){
case 1,2,3:
System.out.println("Hep");
break;
}
But what about in JavaScript, or are there some other kind og syntax for switch?
View 2 Replies
View Related
Jun 25, 2011
If I have this code:
<div id="test" bla="1
">Hey</div>
<div id="test" bla="2
[code]....
View 6 Replies
View Related
Jan 17, 2010
I'm using a script that changes between 2 images when I click on the image: e.g. (An arrow that is pointing up and another that points down) When I click on the up arrow it changes to the down arrow and vice versa.
Now, when I click on the arrow it changes for the first time, but it cant be repeated. My goal is to let it change to the other image whenever i click it.
Code:
function changeMySrc(i) {
if (i == 1) {
document.getElementById("Img1").src="Images/up_arrow.jpg";
} else if (i == 2) {
[Code]...
View 5 Replies
View Related
Jan 15, 2009
ok lets see if i can explain this correctly...
i have a div up here and the id is inuse it chooses the first selection automatically to use
below that is a "menu" when one of the items are clicked it moves the information pulled via php from whichever one is clicked to the inuse div... as you can tell i am new to js and am trying to start out doing some different things with menu onlick items etc..
View 1 Replies
View Related
Sep 20, 2010
I have a few links on my website as follows: <a href="javascript:switchid('a6');">Link 6</a>but when I view source it comes out like this: <a href='javascript:switchid('>Link 6</a>
View 11 Replies
View Related
Mar 15, 2011
Since the upgrade from chrome 9 to chrome 10 my script is showing an error in my variables when i use boolean expressions.
they changed to version V8, Chrome's JavaScript engine.code...
View 1 Replies
View Related
Apr 13, 2011
I'm trying to create a switch image code that will allow the new image to be a link as well. In the list item where you'll see ('blue.jpg') if I try to make this an anchor tag - it breaks the code.
<head>
<script>
function switch1(div) {
if (document.getElementById('blue')) {
[code].....
View 6 Replies
View Related
May 10, 2011
how to make a switch that goes on a button(sorry that i cant describe it better)
View 28 Replies
View Related
Aug 4, 2007
Is it possible to create a Switch Statement in a URL? If so, how? This is what I have so far:
<html>
<body>
<head>
<center>
<Script Language="JavaScript">
function load() {
var load = window.open(http://www.xxx.com/123456789,'','scrollbars=yes,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,st atus=no');
// -->
</Script>
</head>
<br><a href="javascript:load()">Link!</a>
<br><br>
</body>
</html>
View 9 Replies
View Related