473,569 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code works in "CodePen" but not "VS Code" --- Don't know how to fix it.

5 New Member
Ive made a carousel that rotates in CodePen but will not rotate in VSCode. The attribute that makes it rotate is the one that says "data-ride="carousel" In other words if you take that attribute out it won't work.

I'm hoping that someone could tell me why this is not working in VS Code.

Here is the HTML


Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <!doctype html>
  4. <html lang="en">
  5.   <head>
  6.  
  7.     <!-- Required meta tags -->
  8.     <meta charset="utf-8">
  9.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  10.  
  11.     <!-- Bootstrap CSS -->
  12.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  13.    <link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.min.css">
  14.    <link rel="stylesheet" href="node_modules/bootstrap-social/bootstrap-social.css">
  15.     <link rel="stylesheet" href="CSS/Index.css">
  16.  
  17.  
  18.  
  19.     <title>Ristorante Con Fusion: Home</title>
  20.  
  21. </head>
  22.  
  23. <body class="row-centered column-centered">
  24.  
  25.  
  26.  
  27.  
  28.  
  29. <div class="d-flex justify-content-center">
  30. <div class="container d-none d-sm-block" style="margin: 60px 0 40px 0">
  31.     <div class="row row-content">
  32.         <div class="col">
  33.             <div id="mycarousel" class="carousel slide" data-ride="carousel">
  34.                 <div class="carousel-inner" role="listbox">
  35.                     <div class="carousel-item active">
  36.                         <img class="d-block img-fluid" src="images/uthappizza.png" alt="Uthappizza">
  37.                         <div class="carousel-caption d-none d-sm-block">
  38.                             <h2> Uthappizza <span class="badge badge-danger">HOT</span> <span class="badge badge-pill badge-default">$4.99</span></h2>
  39.                             <p class="d-none d-sm-block" >A unique combination of Indian Uthappam (pancake) and
  40.                                 Italian pizza, topped with Cerignola olives, ripe vine
  41.                                 cherry tomatoes, Vidalia onion, Guntur chillies and
  42.                                 Buffalo Paneer.</p>
  43.  
  44.                     </div>
  45.                     </div>  
  46.                     <div class="carousel-item">
  47.                         <img class="d-block img-fluid" src="images/buffet.png" alt="buffet">
  48.                         <div class="carousel-caption d-none d-sm-block">
  49.                             <h2>Weekend Grand Buffet &nbsp;<span class="badge badge-danger">New</span></h2>
  50.                             <p class="d-none d-sm-block"> Featuring mouthwatering combinations with a choice
  51.                                 of live different salads, six enticing appetizers, six main entrees and five
  52.                                 choicest desserts. Free flowing bubbly and soft drinks. All for just
  53.                                 $19.99 per person.
  54.                             </p>
  55.  
  56.                     </div>
  57.                     </div>
  58.                     <div class="carousel-item">
  59.                         <img class="d-block img-fluid" src="images/alberto.png" alt="alberto">
  60.                         <div class="carousel-caption d-none d-sm-block">
  61.                             <h2>Alberto Somayya</h2>
  62.                             <h4>Executive Chef</h4>
  63.                             <p class="d-none d-sm-block">Award winning three-star Michelin chef with wide
  64.                                 International experience having worked closely with
  65.                                 whos-who in the culinary world, he specializes in
  66.                                 creating mouthwatering Indo-Italian fusion experiences.
  67.                             </p>
  68.                     </div>
  69.                     </div>
  70.                 </div>  
  71.                                     <ol class="carousel-indicators">
  72.                                         <li data-target="#mycarousel" data-slide-to="0" class="active"></li>
  73.                                         <li data-target="#mycarousel" data-slide-to="1"></li>
  74.                                         <li data-target="#mycarousel" data-slide-to="2"></li>
  75.                                     </ol>
  76.                                     <a class="carousel-control-prev" href="#mycarousel" role="button" data-slide="prev">
  77.                                         <span class="carousel-control-prev-icon"></span>
  78.                                     </a>
  79.                                     <a class="carousel-control-next" href="#mycarousel" role="button" data-slide="next">
  80.                                         <span class="carousel-control-next-icon"></span>
  81.                                     </a>
  82.                                                     <div class="btn-group" id="carouselButton">
  83.                                                         <button class="btn btn-danger btn-sm" id="carousel-pause">
  84.                                                             <span class="fa fa-pause"></span>
  85.                                                         </button>
  86.                                                         <button class="btn btn-primary btn-sm" id="carousel-play">
  87.                                                             <span class="fa fa-play"></span>
  88.                                                         </button>
  89.                                                     </div>
  90.  
  91.             </div>
  92.         </div>
  93.     </div>
  94. </div>
  95. </div>
  96.  
  97.  
  98.  
  99. <script src="JS/home.js"></script>
  100.     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
  101.         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
  102.         crossorigin="anonymous"></script>
  103.     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
  104.         integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
  105.         crossorigin="anonymous"></script>
  106.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
  107.         integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
  108.         crossorigin="anonymous"></script>
  109.  
  110.     <script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
  111.     <script src="node_modules/popper.js/dist/umd/popper.min.js"></script>
  112.     <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  113.     <script src="JS/home.js"></script>
  114.  
  115.  
  116.  
  117. </body>
  118.  
  119.  
  120.  
Here is the CSS:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  
  4. .carousel {
  5.     background:#512DA8;
  6. }
  7.  
  8. .carousel-item {
  9.   height: 300px;
  10.  
  11. }
  12.  
  13. .carousel-item img {
  14.     position: absolute;
  15.     top: 0;
  16.     left: 0;
  17.     min-height: 300px;
  18. }
  19.  
  20. .carousel-caption {
  21.  
  22.     background-color:rgba(0,0,0,.3);
  23.     padding: 20px 20px 0 20px;
  24.     position:absolute;
  25.     right:60px;
  26.     left:35%;
  27.     top:30px;
  28.     height: 250px;
  29.     width: 60%;
  30.     z-index: 0;
  31.  
  32. }
  33.  
  34.  
  35. #carouselButton {
  36.     right:10px;
  37.     position: absolute;
  38.     bottom: 10px;
  39.     z-index: .8;
  40. }
  41.  
  42.  
  43.  
  44.  
Nov 17 '19 #1
1 4431
gits
5,390 Recognized Expert Moderator Expert
well - i cannot tell what exactly happens in those IDEs - but the important thing is that it has to work in the browser(s). What i can see though so far is that you include a lot of scripts and for example the JS/home.js twice (other scripts as well - may be different versions? at least it looks not clean to me). That should be checked and fixed.

What IDEs are doing to let you preview what you code is often beyond common knowledge - so test the code in the browser(s) and not in the IDE. It could as well be that the code doesnt run in IE - which i would expect because i can imagine that MS is using the IE-engine for the preview - but IE's developer console can tell you where a problem might be. May be VS Code has such as well - but i dont/nor will i use it - so i can only guess.
Nov 20 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1665
by: Farooq Khan | last post by:
hi, my development team has been assigned a project that involves writing our own Web service. i happen to be a C++ programmer, new to C#/ASP.net. i dont know where to begin with......any article/book/link or anything that can help me start coding/getting those concepts, will be appreciated. Thanx, Farooq Khan
2
301
by: Pavel Novotny | last post by:
H I'm trying to import a | seperated text from string variable which represents a tabl with several fields, eg 6124079|PRIRUBA 11 DN250 PN6;CSN131160.0;11369.1;CSN131005.50|KS|11,100000|3437, 6124080|PRIRUBA 11 DN200 PN6;CSN131160.0;11369.1;CSN131005.50|KS|8,870000|2761, I dont know how convert it to dataset or XML... Is there any...
0
1303
by: arunavlp | last post by:
hi, I am new to .net , i am using VB.Net (Web form). I dont know how to pass parameters to stored function. Regards, Arun.S
2
2700
by: hojjatnikan | last post by:
please help me this code 62EH&5gx0wiqoQFw is this name ( Belux) but i dont know how convert it i dont know the algorithm of this code plead help me
2
2484
by: Tiruak | last post by:
Hi there. Thanks in advance for the people reading and trying to help. I'm very begginer using flash and action script, and I tryed to do this one navigation menu. Since I dont have experience doing this, I did things in a way I thought it should work, to create the onmouseover animation of the buttons of my navigation menu. After a couple...
8
5672
risk32
by: risk32 | last post by:
Hi all. I have a really confusing problem. I'm using Swing and I'm trying to do a confirmation box : int reply; String message = "Do you want to input another number?"; String title = "Input Another Number?"; reply = (JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.NO_OPTION) {...
2
2042
by: sailormoon | last post by:
this information i put in data.txt 11221 MOHD IRFAN 80 70 11222 NURUL FITRAH 80 90 11223 MOHD FARHAN 70 80 11224 WAFFIN WARDAH 80 60 11225 SYAMSUL 50 50 99999 TAMAT 0 0 #include<fstream.h>
2
1716
by: sometingsometing | last post by:
hi, I am new and dont know what went wrong. from Tkinter import * import tkMessageBox from pysqlite2 import dbapi2 as sqlite class door: global simpleprint
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.