1👍
You have syntax errors, and add the script in dom ready hadnler
jQuery(function () {
function doIt() {
$(".cambio-imagen").show("slow");
}
$("#boton-imagen").click(doIt);
$("#form-cambio-imagen").submit(function (event) {
$(".cambio-imagen").hide("fast");
});
});
0👍
Errors in your script call Document ready
$(document).ready(function(){
function doIt() {
$(".cambio-imagen").show("slow");
}
$("#boton-imagen").click(doIt);
$("#form-cambio-imagen").submit(function (event) {
$(".cambio-imagen").hide("fast");
});
});
0👍
Kindly use jquery toggle method. You can able to achieve your requirements.
Check this URL : http://api.jquery.com/toggle/
- [Answer]-Django import error between 2 apps
- [Answer]-Installing django on mavericks
- [Answer]-Formatting date and time: in view (template) or in controller?
- [Answer]-Django ForeignKey with default — App registry isn't ready
0👍
Try like
$("#boton-imagen").click(function(){
doIt();
});
And you have syntax errors too..Try like
<script>
$(document).ready(function(){
$("#boton-imagen").click(function(){
$(".cambio-imagen").show("slow");
});
$("#form-cambio-imagen").submit(function (event) {
$(".cambio-imagen").hide("fast");
});
});
</script>
- [Answer]-Django form for 2 related model
- [Answer]-Django 1.6 {{ MEDIA_URL }} has a blank value in template
- [Answer]-Error using include and with in Django template
- [Answer]-PostgreSQL sequence being reset?
0👍
Try it :
function doIt() {
$(".cambio-imagen").show("slow");
}
$("#boton-imagen").click(
doIt();
);
$("#form-cambio-imagen").submit(function (event) {
$(".cambio-imagen").hide("fast");
});
- [Answer]-Placing a link with onClick property in django helptext field
- [Answer]-A simple database inner join using django
- [Answer]-Subclassing django model doesn't carry the Manager
- [Answer]-Get request.user object
Source:stackexchange.com