Created
August 3, 2011 15:57
-
-
Save mitchellhislop/1122994 to your computer and use it in GitHub Desktop.
Switch iFrame code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function switchFrame() { | |
var currentFrame = $("#iframetograb").attr('src'); | |
var newFrame, buttnTxt, newHeightWrapper, newHeightContent; | |
if (currentFrame.indexOf("fb") > 0){ | |
newFrame = ''; | |
buttnTxt = 'Click to signup with Facebook'; | |
newHeightWrapper=470; | |
newHeightContent=430; | |
} | |
else{ | |
newFrame = ''; | |
buttnTxt = 'Click here to signup without Facebook'; | |
newHeightWrapper= 640; | |
newHeightContent=602; | |
} | |
$('#iframetograb').attr('src', newFrame); | |
//use doTimeout to delay this, allowing it to have a chance to load the next frame | |
$.doTimeout(1500, function(){ | |
$('#switchbutton').attr('value', buttnTxt); | |
$('#ibox2_wrapper').height(newHeightWrapper); | |
$('#ibox2_content').height(newHeightContent); | |
}); | |
return ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment