jQuery Tutorial - 36 - Toggle

jQuery Tutorial - 36 - Toggle

thenewboston

12 лет назад

44,598 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Amir Rafighi
Amir Rafighi - 08.10.2017 09:18

The toggle() method was deprecated in jQuery version 1.8, and removed in version 1.9.

Ответить
Everyday Shayar
Everyday Shayar - 18.06.2017 23:56

Plz add in the description that this toggle(function(){code),function(){code}) doesn't work anymore as per the updates of jquery.

Ответить
Kapil Varshney
Kapil Varshney - 23.05.2017 20:14

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

Ответить
Prakash Besra
Prakash Besra - 24.04.2017 10:58

$(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 !!!
});
});

Ответить
kjkl jom
kjkl jom - 05.03.2017 06:05

when I create the html page with jsp file. external javascript does not work any idea?

Ответить
Tom E
Tom E - 16.02.2017 15:51

I'm getting a cool effect but not the desired one. Better luck next time.

Ответить
FitnessMotivation
FitnessMotivation - 16.10.2016 15:24

bucky you are AWESOME !!!!!!!! :)

Ответить
Gaurav Singh
Gaurav Singh - 10.10.2016 00:26

164 more vedios left . will it make me a better web developer ?

Ответить
Bill Gilmore
Bill Gilmore - 21.07.2016 17:00

Good support in the comments everyone, thanks. This had me confused

Ответить
return 0;
return 0; - 27.12.2015 21:33

toggle() function is not works in version 1.11.3

Ответить
CookieByte
CookieByte - 26.04.2015 15:21

this method was removed in jQuery 1.9 so it does something else, check it out on jquery (.) com

Ответить
Altaranalt
Altaranalt - 28.10.2014 18:45

I was struggling with toggle until I found this video. Thanks =)

Ответить
Maolo92
Maolo92 - 08.09.2014 12:32

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')

Ответить
Samuel Araiza
Samuel Araiza - 26.07.2014 05:49

I believe this tutorial is outdated.

Ответить
Delia Flora Miles
Delia Flora Miles - 04.03.2014 15:43

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.

Ответить
Trần Minh Hiệp
Trần Minh Hiệp - 01.03.2014 15:03

Thank a lot. 
It would be better if you upload source file.

Ответить
jautrsezis
jautrsezis - 16.01.2014 18:30

Well, 164 videos more left... This is just EPIC! ;D

Ответить
pavalige
pavalige - 13.12.2013 13:21

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  ??

Ответить
Asraaf Ali Bhuttoo
Asraaf Ali Bhuttoo - 23.10.2013 00:46

wahahahaa he's gay

Ответить
Sergmont
Sergmont - 26.07.2013 20:20

everyday I'm TO-GGO-GGOLIN

Ответить
f4st1ll0
f4st1ll0 - 17.07.2013 22:20

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.

Ответить
Lauris Skraucis
Lauris Skraucis - 28.06.2013 00:43

WHAT THE FUCK?!

Ответить
Mohamed Gawish
Mohamed Gawish - 05.06.2013 17:37

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

Ответить
Lucie Stehlíková
Lucie Stehlíková - 29.05.2013 22:14

i love jQuery just becaus of this great tutorial :D thx alex

Ответить
guardadotube
guardadotube - 07.05.2013 22:15

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

Ответить
Emanuel Bucur
Emanuel Bucur - 20.02.2013 20:40

At last ! You simply copied the script line when including your second script .. Up until now you just re-wrote it every time ...

Ответить
wrong choice
wrong choice - 20.02.2013 13:06

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

Ответить
Guillaume Deblock
Guillaume Deblock - 08.02.2013 14:06

Be careful, .toggle seems to be removed since jQuery 1.9 upgrade.

Ответить
crayfish
crayfish - 17.12.2012 19:38

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

Ответить
zanpaktuh
zanpaktuh - 06.11.2012 09:13

Disturbing

Ответить
jasonbudd06
jasonbudd06 - 21.10.2012 07:21

I keep waiting for the image slider tutorial!

Ответить
Tim Suite
Tim Suite - 04.09.2012 11:24

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.

Ответить
supastar
supastar - 03.05.2012 19:31

sweet

Ответить
Rahilw
Rahilw - 02.05.2012 12:07

buttons are good for examples instead of anchors!

Ответить
007koko007
007koko007 - 29.02.2012 13:52

Wow.. I can make my own argument clinic with this!!! :) Great tutorials btw! Very helpful. I'm actualy learning from these videos!

Ответить
sith4life
sith4life - 19.02.2012 23:59

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 :)

Ответить
sutistalica
sutistalica - 11.01.2012 07:59

haha... alex.. i just respect u man ...

Ответить
308tube
308tube - 21.08.2011 00:24

example use of this is when you want to show or hide info on a section of your website.

Ответить