doctorbill
asked on
java jquery
-------------------------- ---------- ---
<!doctype html>
<html>
<head>
<title>Test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery-1.9.0.js"></sc ript>
<script type="text/javascript">
$(document).ready(function () {
$('a#tog').toggle(function () {
$('#result2').fadeIn('slow ');
return false;
},
function() {
$('#result2').fadeOut('slo w');
return false;
});
});
</script>
<script type="text/javascript">
$(function() {
$('a.link').click(function (e) {
e.preventDefault();
$.get($(this).attr('href') ,{},functi on(data) {
$('#result').html(data);
}); // <= missing in original script
});
})</script>
</head>
<body>
<div><a class="link" href="test.txt">Click</a>< /div><br />
<div align="right" style="width:200px; background:#00cc33;">dfdfd </div><br />
<div id="result" style="width:400px; position:absolute;left:250 px; top:100px; background:#00CC33;"></div >
<div align="right" style="width:100px; background:#00CC33; id="result2; position:relative;left:100 px; top:15px;">ggggg</div>
</body>
</html>
-------------------------- ---------- -------
I am trying to get this element in the above page to fade in / out with the jquery function:
<script type="text/javascript">
$(function() {
$('a.link').click(function (e) {
e.preventDefault();
$.get($(this).attr('href') ,{},functi on(data) {
$('#result').html(data);
}); // <= missing in original script
});
})</script>
<!doctype html>
<html>
<head>
<title>Test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery-1.9.0.js"></sc
<script type="text/javascript">
$(document).ready(function
$('a#tog').toggle(function
$('#result2').fadeIn('slow
return false;
},
function() {
$('#result2').fadeOut('slo
return false;
});
});
</script>
<script type="text/javascript">
$(function() {
$('a.link').click(function
e.preventDefault();
$.get($(this).attr('href')
$('#result').html(data);
}); // <= missing in original script
});
})</script>
</head>
<body>
<div><a class="link" href="test.txt">Click</a><
<div align="right" style="width:200px; background:#00cc33;">dfdfd
<div id="result" style="width:400px; position:absolute;left:250
<div align="right" style="width:100px; background:#00CC33; id="result2; position:relative;left:100
</body>
</html>
--------------------------
I am trying to get this element in the above page to fade in / out with the jquery function:
<script type="text/javascript">
$(function() {
$('a.link').click(function
e.preventDefault();
$.get($(this).attr('href')
$('#result').html(data);
}); // <= missing in original script
});
})</script>
ASKER
So how do I make my element in the page above fade in and out - what code changes are necessariy?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks - excellent as usual
http://www.landonbaseball.com/
It creates a fade-in / face-out effect, presenting a caption over the banner image when you mouse-over the image. You can use view source to see the jquery statements near line 45, showing in the snippet below.
Open in new window
In my experiments with fadeTo(), I found that a value of 0.001 was sufficient to become invisible and a value of 0 created some quirkiness when I wanted the page element to fade back into view.HTH, ~Ray