Created
June 17, 2014 20:28
-
-
Save flexgrip/cef3420953e2ff69fef5 to your computer and use it in GitHub Desktop.
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
<ul class="lb-my-images unstyled"> | |
<li class="default-image"> | |
<a href="#" class="img-choose-btn"> | |
<img src="https://d723-leadbox-redesign-dot-leadpage-test.appspot.com/static/lp702/img/leadbox-image-placeholder.png"> | |
</a> | |
</li> | |
<li class="my-images"><a href="#" class="image-choose-btn"><img alt="Image" src="https://lh4.ggpht.com/QccS17iRxed2xgpap17IeP3qx8DshmBH-OrdGcFqxJjfprMWo6oPDk1l3KaXw3PkGCBS26QEh-PItlbqQYLLcG1t=s100"></a></li> | |
<li class="my-images"><a href="#" class="image-choose-btn"><img alt="Image" src="https://lh6.ggpht.com/V4-_R-IHlKloIO0_dgqodM7iqTtXsyWBqiV03nEy90JZVQmV5cnmytXPQ0mYPw4J4awy7HNQ8UcY9Lyc9yOsUjTtUuo=s100"></a></li> | |
<li class="my-images"><a href="#" class="image-choose-btn"><img alt="Image" src="https://lh5.ggpht.com/Hnuucz23ZmMZ4ECfHuUyvnotvAEEvFdlCK820vQSLxq4N51IAwcXXXD7RsqyETC8hygg4r6lh2Phqiz2OwtvOIPk=s100"></a></li> | |
</ul> | |
var selectImage = function(btn, url, id) { | |
$form_image.data('id', id); | |
if (!id) { | |
$form_image.addClass('no-image'); | |
if (form_image) | |
$('#form-preview form').addClass('no-image'); | |
} else { | |
setImage(url, id); | |
$form_image.removeClass('no-image'); | |
if (form_image) | |
$('#form-preview form').removeClass('no-image'); | |
} | |
markChanged(); | |
}; | |
$form.find(".default-image a").click(function() { | |
selectImage(this, $form.find(".default-image img").attr("src"), "default"); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment