Posted: Mon Jan 29, 2007 6:50 pm
thanks, kieran!
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$(function(){
$('.replace').children().applyClass($(this).className).click(function(){
$(this).parents('form')[0].submit();
}).load(function(){
$(this).children('.button').value = '';
});
});
Code: Select all
.replace
{
}
.button
{
border: 0;
cursor: pointer;
}
.button:hover
{
background-position: 0px 0px;
}
.button span
{
display: none;
}
.login
{
background: url(../images/buttons/login.gif) no-repeat 0px -20px;
width: 61px;
height: 20px;
display: block;
}
Code: Select all
<a class="replace" href="javascript:;"><input type="submit" value="Login" class="login button" /></a>but even though that error is coming up, it seems to be working other than the submit value thing.error console wrote:$(".replace").children().applyClass is not a function
my_rollover.js Line 29
Code: Select all
$(function(){
$('form input.replace').wrap('<a class="save button"></a>').hide().parent().click(function(){
$(this).parents('form').submit();
});
});Code: Select all
<html>
<head>
<script src="http://jquery.com/src/jquery-latest.pack.js" type="text/javascript"></script>
<style>
input {
border: 1px solid #000000; /* Black border for trials */
width: 150px;
height: 28px;
}
input.elHover {
border: 1px solid #ff0000; /* Red border for trials */
width: 150px;
height: 28px;
}
</style>
<script type="text/javascript">
$(function(){
$('input').hover(function(){
$(this).toggleClass('elHover'); // mouse over function
},function(){
$(this).toggleClass('elHover'); // mouse out function
});
});
</script>
</head>
<body>
<form>
<input type="button" value="" class="button"/>
</form>
</body>
</html>Code: Select all
$(function(){
$('.replace').addClass('button').children('input').val('');
});
Code: Select all
<a class="replace"><input type="submit" value="Login" class="login" /></a>
<a class="replace"><input type="submit" value="Submit" class="submit" /></a>
<a class="replace"><input type="submit" value="Continue" class="continue" /></a>Code: Select all
.button input
{
border: 0;
}
.button input:hover
{
background-position: 0px 0px;
}
.button input.login
{
background: url(../images/buttons/login.gif) no-repeat 0px -20px;
width: 61px;
height: 20px;
display: block;
}
.button input.submit
{
background: url(../images/buttons/submit.gif) no-repeat 0px -20px;
width: 71px;
height: 20px;
display: block;
}
.button input.continue
{
background: url(../images/buttons/continue.gif) no-repeat 0px -20px;
width: 155px;
height: 20px;
display: block;
}How can you forget about IE. It is the ^%@#^%*! broken browser that is used by about 80% of the world.The Ninja Space Goat wrote:EDIT: DARN! I forgot about Internet explorer! That freakin thing.Back to the drawing board