What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Script not working

sabsac

New member
Joined
Sep 9, 2022
Messages
3
Reaction score
0
HTML Coins
0
Please see attached html and css files. The java script is not working on my computer after cliking open the developer tools in the chrome browser.Kindly point out thr error in the code.
 
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>University Website Design - Easy Tutorials</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?f...ht@0,400;0,600;1,100;1,200;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<section class="header">
<nav>
<a href="index.html"><img src="images/logo.png" alt="logo"></a>
<div class="nav-links" id="navLinks">
<i class="fa fa-times" onclick="hideMenu()"></i>
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">COURSE</a></li>
<li><a href="">BLOG</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</div>
<i class="fa fa-bars" onclick="showMenu()"></i>
</nav>
<div class="text-box">
<h1>World's Biggest University</h1>
<p>Making a Website is one of the easiest thing in the world.You just need to learn HTML, CSS,<br> Javascript and you are good to go.
</p>
<a href="" class="hero-btn">Visit Us To know More</a>
</div>
</section>
<script>
var navLinks = document.getElementById("navLinks");
function = showMenu() {
navLinks.style.right ="0";
}
function = hideMenu() {
navLinks.style.right ="-200px";
}
</script>
</body>
</html>
 
the javascript is not working in the chrome developer tools enabled browser.
 
Well, you have define your function incorrectly, you must try this code to fix this issue.

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>University Website Design - Easy Tutorials</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<section class="header">
<nav>
<a href="index.html"><img src="images/logo.png" alt="logo"></a>
<div class="nav-links" id="navLinks">
<i class="fa fa-times" onclick="hideMenu()"></i>
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">COURSE</a></li>
<li><a href="">BLOG</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</div>
<i class="fa fa-bars" onclick="showMenu()"></i>
</nav>
<div class="text-box">
<h1>World's Biggest University</h1>
<p>Making a Website is one of the easiest thing in the world. You just need to learn HTML, CSS,<br> Javascript and you are good to go.</p>
<a href="" class="hero-btn">Visit Us To know More</a>
</div>
</section>
<script>
var navLinks = document.getElementById("navLinks");

function showMenu() {
navLinks.style.right = "0";
}

function hideMenu() {
navLinks.style.right = "-200px";
}
</script>
</body>
</html>

Thanks
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back