Комментарии:
The toggle() method was deprecated in jQuery version 1.8, and removed in version 1.9.
ОтветитьPlz add in the description that this toggle(function(){code),function(){code}) doesn't work anymore as per the updates of jquery.
ОтветитьI cant use this. Actually i am using this same but loading time is toggle use . i want to click on button than toggle is workshyorking ???? so please help me
Ответить$(document).ready(function () {
$("#button").click(function () {
var button_val=$("#button").val();
if(button_val=='Hide'){
$(this).attr("value","Show");
$("#field").hide();
}else{
$(this).attr("value", "Hide");
$("#field").show();
}
//$("#field").toggle('slow'); // now deprecated !!!
});
});
when I create the html page with jsp file. external javascript does not work any idea?
ОтветитьI'm getting a cool effect but not the desired one. Better luck next time.
Ответитьbucky you are AWESOME !!!!!!!! :)
Ответить164 more vedios left . will it make me a better web developer ?
ОтветитьGood support in the comments everyone, thanks. This had me confused
Ответитьtoggle() function is not works in version 1.11.3
Ответитьthis method was removed in jQuery 1.9 so it does something else, check it out on jquery (.) com
ОтветитьI was struggling with toggle until I found this video. Thanks =)
ОтветитьWATCH OUT! This element i deprecated, the new toggle() element switches toggles the visibility of the paragraph. You could also try use toggleClass('class1 class2')
ОтветитьI believe this tutorial is outdated.
ОтветитьI solved the toggle problem. I downloaded the JQuery version 1.6.2 which is the one shown by Alex in tutorial 3, and now it works!!! Looks like in older versions toggle function as it was implemented is deprecated. I don't know how it works with the actual versions.
ОтветитьThank a lot.
It would be better if you upload source file.
Well, 164 videos more left... This is just EPIC! ;D
ОтветитьI checked my code umpteen times and all i get is the link for a split second and then no link it toggles to "No" and stays there ??
Ответитьwahahahaa he's gay
Ответитьeveryday I'm TO-GGO-GGOLIN
ОтветитьAs this wasn't working for me I just thought of a way around: var choice = 0; $('#click_me').click(function() { if(choice==0) { $('#click_event').html('Yes'); choice = 1; } else { $('#click_event').html('No'); choice = 0; } }); With this you can "toggle" between more than two elements.
ОтветитьWHAT THE FUCK?!
Ответитьim having trouble with the toggle function, it acts like fadeIn, not as described in the tut, has it been changed by the jquery developers.... its even defined differently here api.jquery.com/toggle/ kickass tut btw
Ответитьi love jQuery just becaus of this great tutorial :D thx alex
ОтветитьFor Jquery 1.9 + here is a code snippet you can use in place of Alex's to get a similar effect: stackoverflow. com/a/15195528/1569114
ОтветитьAt last ! You simply copied the script line when including your second script .. Up until now you just re-wrote it every time ...
Ответитьversion deprecated: 1.8, removed: 1.9 Oh shit, toggle between functions only works in jquery 1.7.2 and earlier versions. I had to spend lots of time to find out this, it doesn't work in version 1.9
ОтветитьBe careful, .toggle seems to be removed since jQuery 1.9 upgrade.
Ответитьthank you for this. I was just wondering if it's possible to toggle between anything more than two. now, let me try that. =D
ОтветитьDisturbing
ОтветитьI keep waiting for the image slider tutorial!
ОтветитьBTW you can toggle between any number of functions, not just two. When I hear "toggle", I think two options, but that is not the case. This would be perfect for a really simple image slider.
Ответитьsweet
Ответитьbuttons are good for examples instead of anchors!
ОтветитьWow.. I can make my own argument clinic with this!!! :) Great tutorials btw! Very helpful. I'm actualy learning from these videos!
Ответитьone way I have seen this implemented is in some flash based video player website you can toggle the background colour of the page in order to increase the contrast and add a more cinematic feel :)
Ответитьhaha... alex.. i just respect u man ...
Ответитьexample use of this is when you want to show or hide info on a section of your website.
Ответить