|
Hey,
Any ideas why this won't work? i want the text and image to go back to the original position then repeat the previous animation, so the text goes out to the right then resets, and comes back in from the left, and the same for the image ..
<
<html>
<head>
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script type="text/javascript">
$(document).ready(function(){
bringIn();
function bringIn()
{
$("#animation_image").animate({top:10},"slow");
$("#animation_text").animate({left:30},2000);
window.setTimeout(takeOut, 5000);
};
function takeOut()
{
$("#animation_image").animate({top:401},"slow").queue(function(){
$("#animation_text").animate({left:1000},"slow",bringIn);
$("#animation_text").css({"left":"-600px"});
$("#animation_image").css({"top":"-200px"});
$("#animation_text").html("Why you no working");
});
};
});
</script>
</head>
<body>
<button>Start Animation</button>
<br /><br />
<style type="text/css">
#animation_box
{
position:relative;
width:800px;
height:300px;
margin:0px auto 0px auto;
background-color:#333333;
overflow:hidden;
}
#animation_text
{
position:absolute;
display:block;
z-index:2;
left:-600px;
top:20px;
width:300px;
font-family:Arial, Helvetica, sans-serif;
font-size:30px;
line-height:45px;
color:white;
}
#animation_image
{
position:relative;
display:block;
float:right;
top:-200px;
margin-right:10px;
}
</style>
<body>
<div id="animation_box">
<div id="animation_text">
<ul>
First 3 hours £36
</ul>
</div>
<div id="animation_image">
<img src="img/slides/img8.jpg" id="animation_img" width="420px" height="280px" alt="Car image"/>
</div>
</div>
</body>
</html>
Thanks for all your help
|
|
|
|
|
how can i pass parameter from 1 page to another using javascript i cannot use query string and cookies.
{ my task is i have a page page1 in which there are two links on clicking that link it open in iframe of new page page2 }
any suggestion would be great help for me
Thanks in advance.
|
|
|
|
|
|
Take hidden field in the form assign variable value.On first page tag write window.open("Page name") and on second page <script> use this code window.opener.document.getElementById('text1').value
|
|
|
|
|
Hi,
I have a myPage.aspx page and 2 user controls, ucA and ucB. ucA (parent control) is being used in ucB (child control inherits ucA). Finallly ucB is registered in myPage.aspx. I have two dropdowns in ucB.
Now, I am trying to put the selected values of these dropwdowns in a hidden variables using the below code and I am putting this in myPage.aspx page_load code
Page.ClientScript.RegisterHiddenField("LabValue", labname selectedvalue using FindControl)
Page.ClientScript.RegisterHiddenField("ClientValue", ClientName SelectdValue using FindControl))
The above code runs fine and no errors.
Now in the exeternal .js file I am accessing this values as
var lv = document.getElementById("LabValue").value;
var cv = document.getElementById("ClientValue").value;
All look fine. But the issue is no matter what values I put in the LabValue and ClientValue hidden fields I always get the values as 0 for lv and cv (java script variables).
Say for instance if LabValue is 10002 when I try to access it via javasacript using document.getElementById("LabValue").value; I always get 0 instead of 10002. It is the same case with the other hidden field too.
When I looked at the myPage.aspx viewsource I always see
<input type="hidden" name="LabValue" id="LabValue" value="0" />
Am I missing some thing here?
Thanks in advance,
L
modified 24-Feb-12 20:04pm.
|
|
|
|
|
|
I assume you are after the functionality of tracking the mouse position using those red lines on the top and left of the content area...
You can use the jQuery mouse move event to track the mouse position. You can then position some red colored divs at the x and y coordinates of the mouse.
|
|
|
|
|
No Sir,
I want the Ruler which is On the corner of the Image Layout with margin.
If you can think then I Can.
|
|
|
|
|
Did you bother reading the source code?
|
|
|
|
|
Hello Dear,
I am providing a code you add own event just like the following code commented.
<script type="text/javascript">
var OnMapCreating = function(map) {
var mapParser = Map1.GetMapParser();
mapParser.addControlsInJson = function(controls, onDrawEnd, onEditEnd) {
for (var key in controls) {
if (controls[key]) {
if (key == 'Modify') {
if (onEditEnd) {
controls[key].onModificationEnd = onEditEnd;
}
} else if (key != 'Normal') {
if (onDrawEnd) {
controls[key].featureAdded = onDrawEnd;
//controls[key].featureAdded = function() {
// alert('ok');
//}
}
}
this.map.addControl(controls[key]);
}
}
}
}
script>
|
|
|
|
|
i'm trying to call a web service from java script code stored NOT in Html but in an extenarl file .js. My code is this:
service.useService("http://localhost:10000/WebS_cod_01/WebS_codEurService.asmx?wsdl", "WebS");
Photo = service.WebS.callService("webS_codEurProcessWS" , photoID);
checking with Firebug i find this message:
"service is not defined"
where i'm wrong ?
thanks in advance
|
|
|
|
|
|
i am using console.log() in my code.where the output will be printed.
modified 16-Feb-12 0:42am.
|
|
|
|
|
|
|
Hi,
i like to disable the buttons on check of the checkbox....using Jquery
i have tried in 3 different ways...
1.attr("disabled", true)-- working in IE not in FF
2.attr("disabled", "disabled")- working in IE not in FF
3.attr("diabled") not working in both...
i want to know the property which is supported by all the browsers(like safari, chrome etc..)
thanks in advance
|
|
|
|
|
I suspect the problem is somewhere else. $('#id').attr('disabled',true) is working for me in FireFox, IE, Chrome and Opera. Setting it back to 'false' enables the inputs again.
|
|
|
|
|
I agree with graham
I tested with
below code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<div>
<input type='checkbox' value='10' id='id'> <label for='id'>Test Checkbox</label>
</div>
<BUTTON onclick='a=!($("#id").attr("disabled")); $("#id").attr("disabled",a)'>
test
</BUTTON>
it work fine
|
|
|
|
|
If I will use <asp:button ...=""> and <asp: checkbox...=""> ....How can I disable checkbox
|
|
|
|
|
The code you are using has always worked for me so not sure what's wrong but as a point, the second one in your list is the correct one. If you are trying to enable the check boxes again you will have to use the removeAttr method as W3 standards say that the mere presence of the disabled attribute means the control is disabled, regardless of value (which some of the major browsers follow).
As for why your check boxes don't disable I can only suggest that IE and FF are handling your HTML differently (check Id's are the same, that you are only trying to set the disabled attribute after full page load (use $(document).ready if you aren't!) etc. etc.)
Hope this helps,
Ed
|
|
|
|
|
How can i use backbone.js.What is the purpose of backbone.js.Post some sample code.Actually i tried on google.I am not getting correct solution.
|
|
|
|
|
DeepthiTanguturi wrote: Actually i tried on google.
And you couldn't find this[^]?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
I've hit a wall trying to use javascript to write a table with some image tags. I'm looping through an array of image names, then setting their src attribute. The function is creating the tags, but all that displays is the 'missing image' thumbnail. The function is fired via a button. Below is my code.
Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex">
<title>Testing Javascript</title>
<script type="text/javascript">
function getImages() {
var allImages, vRow, vCell, vText, vImg;
var vCnt, i, j, x, y;
var vTable = document.createElement("TABLE");
var vTBody = document.createElement("TBODY");
vTable.appendChild(vTBody);
var images = new Array();
images[0] = "image1.jpg";
images[1] = "image2.jpg";
images[2] = "image3.jpg";
vCnt = images.length;
for (i=0; i < vCnt; i++)
{
vRow = document.createElement("TR");
vCell = document.createElement("TD");
var image = images[i];
vImg = document.createElement("IMG");
vImg.setAttribute("src", "images/" + image);
vCell.appendChild(vImg);
vRow.appendChild(vCell);
vTBody.appendChild(vRow);
}
var vTableContainer = document.getElementById("vTableContainer");
vTableContainer.appendChild(vTable);
}
</script>
</head>
<body bgcolor = "#FFFFFF">
<h2>Javascript and Images</h2>
<div id="parentDiv">
<p>
Trying to set the image source with js...
</p>
<div id="childDiv">
<form method="GET">
<input type="button" value="DISPLAY IMAGES" onClick="getImages();" />
</form>
</div>
<div id="vTableContainer"></div>
</div>
</body>
</html>
|
|
|
|
|