Nav Tab Panes

7 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€93.82
List Price:  €131.35
You save:  €37.53
£80.04
List Price:  £112.06
You save:  £32.01
CA$137.37
List Price:  CA$192.33
You save:  CA$54.95
A$154.22
List Price:  A$215.91
You save:  A$61.69
S$136.04
List Price:  S$190.47
You save:  S$54.42
HK$782.81
List Price:  HK$1,095.97
You save:  HK$313.15
CHF 91.32
List Price:  CHF 127.85
You save:  CHF 36.53
NOK kr1,090.63
List Price:  NOK kr1,526.93
You save:  NOK kr436.29
DKK kr699.95
List Price:  DKK kr979.95
You save:  DKK kr280
NZ$168.27
List Price:  NZ$235.59
You save:  NZ$67.31
د.إ367.20
List Price:  د.إ514.09
You save:  د.إ146.89
৳10,970.78
List Price:  ৳15,359.53
You save:  ৳4,388.75
₹8,343.20
List Price:  ₹11,680.82
You save:  ₹3,337.61
RM477.85
List Price:  RM669.01
You save:  RM191.16
₦120,104.65
List Price:  ₦168,151.32
You save:  ₦48,046.66
₨27,785.94
List Price:  ₨38,901.43
You save:  ₨11,115.49
฿3,669.86
List Price:  ฿5,137.95
You save:  ฿1,468.09
₺3,239.63
List Price:  ₺4,535.62
You save:  ₺1,295.98
B$511.43
List Price:  B$716.03
You save:  B$204.59
R1,895.28
List Price:  R2,653.47
You save:  R758.18
Лв183.49
List Price:  Лв256.90
You save:  Лв73.40
₩138,351.23
List Price:  ₩193,697.26
You save:  ₩55,346.02
₪371.58
List Price:  ₪520.23
You save:  ₪148.65
₱5,684.98
List Price:  ₱7,959.20
You save:  ₱2,274.22
¥15,391.60
List Price:  ¥21,548.85
You save:  ¥6,157.25
MX$1,659.16
List Price:  MX$2,322.90
You save:  MX$663.73
QR364.51
List Price:  QR510.33
You save:  QR145.82
P1,372.15
List Price:  P1,921.07
You save:  P548.91
KSh13,023.69
List Price:  KSh18,233.69
You save:  KSh5,210
E£4,846.78
List Price:  E£6,785.69
You save:  E£1,938.90
ብር5,686.22
List Price:  ብር7,960.94
You save:  ብር2,274.71
Kz83,519.11
List Price:  Kz116,930.10
You save:  Kz33,410.98
CLP$97,077.66
List Price:  CLP$135,912.62
You save:  CLP$38,834.95
CN¥723.78
List Price:  CN¥1,013.33
You save:  CN¥289.54
RD$5,914.87
List Price:  RD$8,281.05
You save:  RD$2,366.18
DA13,461.22
List Price:  DA18,846.25
You save:  DA5,385.02
FJ$226.58
List Price:  FJ$317.23
You save:  FJ$90.64
Q778.51
List Price:  Q1,089.95
You save:  Q311.43
GY$20,931.33
List Price:  GY$29,304.70
You save:  GY$8,373.37
ISK kr14,137.58
List Price:  ISK kr19,793.18
You save:  ISK kr5,655.60
DH1,005.10
List Price:  DH1,407.18
You save:  DH402.08
L1,762.87
List Price:  L2,468.10
You save:  L705.22
ден5,781.33
List Price:  ден8,094.10
You save:  ден2,312.76
MOP$806.90
List Price:  MOP$1,129.69
You save:  MOP$322.79
N$1,879.82
List Price:  N$2,631.82
You save:  N$752
C$3,679.46
List Price:  C$5,151.39
You save:  C$1,471.93
रु13,336.81
List Price:  रु18,672.07
You save:  रु5,335.26
S/369.11
List Price:  S/516.76
You save:  S/147.65
K383.43
List Price:  K536.82
You save:  K153.39
SAR375.08
List Price:  SAR525.13
You save:  SAR150.04
ZK2,496.54
List Price:  ZK3,495.26
You save:  ZK998.71
L466.66
List Price:  L653.34
You save:  L186.68
Kč2,375.60
List Price:  Kč3,325.93
You save:  Kč950.33
Ft36,904.80
List Price:  Ft51,668.20
You save:  Ft14,763.40
SEK kr1,084.54
List Price:  SEK kr1,518.40
You save:  SEK kr433.86
ARS$86,666.74
List Price:  ARS$121,336.90
You save:  ARS$34,670.16
Bs693.26
List Price:  Bs970.60
You save:  Bs277.33
COP$381,910.12
List Price:  COP$534,689.44
You save:  COP$152,779.32
₡50,802.20
List Price:  ₡71,125.11
You save:  ₡20,322.91
L2,467.65
List Price:  L3,454.81
You save:  L987.15
₲739,360.99
List Price:  ₲1,035,134.97
You save:  ₲295,773.97
$U3,866.49
List Price:  $U5,413.24
You save:  $U1,546.75
zł402.36
List Price:  zł563.33
You save:  zł160.96
Already have an account? Log In

Transcript

Hello, in this video, we're going to show you how to create tab paint like a section for each tab. So we've got these tabs at the moment, we click them, they don't do anything at all. But what we're going to do is create a separate section. So when we select one, the content for that section appears. And it doesn't refresh the page or anything like that is all handled via JavaScript. We're not going to be coding any JavaScript is all built into bootstrap is just basically classes and elements.

So we're just going to do it for the first navigational menu. And inside of the unordered list, we're going to create a div. And this is essentially going to be the container for all the different tab sections and you put a class of tab content. Inside here, we're going to create more divs and each one of these divs is one section within our navigational menu. For this, just put a roll of tab, panel, pre class, tab dash pane. And we're just going to set the first one to active simply because we're going to make it correspond to the first item.

So if you want to didn't want to be active needs to do that, and we're gonna finally put an ID, the ID, we'll just gonna call it Akali one, and that'll get the job done. I'm gonna put the number one here. And the reason we need the ID is because we need to link each one of these items to one of the sections, and we use IDs for that. So I'm going to copy and paste that to save time. I'm going to create three sections you might be thinking, well the for item one, you don't need a section for each item. And the other thing is, this item is disabled.

So we should Be able to click it and go to a section hence why we're not going to have a section for it. So what we're going to do now is save it. Refresh and see Daisy that should not look like that. So I'm clearly missing something. So have a look what we got triggered div of class tab dash count up, put them all as active for us. Not missing, I've got extra stuff.

So if I refresh that, there you go. And if I click on these, you might be thinking while they're working, and like I said, we need to link these items to their corresponding pain. And to do that is really simple. First of all, we need to change the href. So yes, hash, then the actual ID itself and one, two, and three. So if we save that, refresh the browser, I thinking, why isn't he working anymore?

Why isn't it working? at all, yeah. And the reason for that is, we still need to tell each individual list item, or more specifically the H ref element, what type of data it's toggling. So for that input data dash toggle equals tab. So it's just saying, when I clicked this, I'm activating a tab, copy and paste that it doesn't matter whether it's active or not. And obviously, we don't need it for the last one.

So if I go back refresh, right click it. It's not changing. So we need to have a look at why it isn't changing. So data desktop tab, we've got the hash one hash to hash free, which looks all good. So let's just give a quick refresh. Okay, so clearly I am missing some piece of code, data dash toggle equals tab.

I think what I'm missing is a role role equals tab. Copy and paste this. Copy and paste in loads of stuff. So Copy that. Paste, paste, save, refresh. Yeah, it's really weird why it isn't updating.

So let's have a look exactly what we've got. Class tab dash pain, Alex. Okay, active one should be active obviously. div class tab dash content. tab panel. That's the roll.

Yeah, it is looking at Okay, I don't see why wouldn't be working? Well, I'm actually going to do is just try changing the ID to something else I'm going to put profile or both about no change the ID in here as well. Home profile about save that refresh. And now it's working. So it would appear I didn't know this, it would appear that you can't have numbers for the ID and for the H ref. So just bear that in mind is good that put it there.

So we've discovered that so if I just go back refresh the competitors, as you can see on switching between the different sections, and the contents changing not only that the actual tab is being selected as well. Have the opponent do anything with this. Finally, what we're going to show you is how to make the tabs fade in. And because at the moment the very static, so if I go back, click it, they automatically appear. They don't have any animation. You can obviously simulate this with jQuery, or he used some built in classes to do that for the section that is active prop fade and put a class of in every other section is called fade.

Fade, save that refresh. And as you can see the content aka number two, just keep your eye on lists, fading in and out. So once you've got buttons, headings, text, images, that sort of stuff. It looks really, really cool fading in and out. And the next task we want you to essentially implement what we've done with this with the other navigational menus. If you have any questions feel free to post them on sonar learning Dakota UK for slash question dot php.

That's our free education platform. Please rate, comment and subscribe as it really does help us and as usual, thanks for watching and I hope you have a great day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.