2017-08-12 7 views
-1

約1分後、下のスニペットに表示されているトップバーのみに高さが設定されます。スクリプトを実行して、最終的に一番上のバーだけが表示されることを確認してください。すべての助けをいただければ幸いです!このエラーは、カスタムスクロールバーの実装後に発生しました。divの高さのリセットエラーを修正するには

私も、私は問題を修正し、このJS Fiddle

\t <link rel="stylesheet" href="http://manos.malihu.gr/repository/custom-scrollbar/demo/jquery.mCustomScrollbar.css"> 
 
\t <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 
 
\t <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> 
 
\t 
 
\t <link rel="stylesheet" href="http://manos.malihu.gr/repository/custom-scrollbar/demo/jquery.mCustomScrollbar.css"> 
 
\t 
 
\t <style> 
 
\t \t html, body{ height: 100%; } 
 
\t </style> 
 
\t 
 
</head> 
 

 
<body class="full-page"> 
 
\t <header> 
 

 
\t \t <hr /> 
 
\t </header> 
 
\t 
 
\t <div id="demo"> 
 
\t \t <section id="examples"> 
 
\t \t \t 
 
\t \t \t <div class="content mCustomScrollbar" data-mcs-theme="minimal"> 
 

 
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> 
 
    <style type="text/css"> 
 
    .wrap { 
 
    position: relative; 
 
} 
 
.wrap .nav-bar .navbar-brand { 
 
    margin-top: 15px; 
 
} 
 
.wrap .nav-bar .navbar-form { 
 
    margin-top: 25px; 
 
} 
 
.wrap .nav-bar .nav { 
 
    float: right !important; 
 
} 
 
.wrap .nav-bar .nav .dropdown span.fa, 
 
.wrap .nav-bar .nav .dropdown span.caret { 
 
    margin-right: 10px; 
 
} 
 
.wrap .nav-bar .nav .dropdown-menu { 
 
    background: #222; 
 
    left: auto; 
 
    width: 200px; 
 
    right: 0; 
 
} 
 
.wrap .nav-bar .nav .dropdown-menu > li > a { 
 
    color: #ddd; 
 
    padding: 8px; 
 
} 
 
.wrap .nav-bar .nav .dropdown-menu > li > a:hover { 
 
    background: #3355ff; 
 
} 
 
.wrap .side-menu-link { 
 
    left: 21em; 
 
} 
 
.wrap .burger { 
 
    position: relative; 
 
    width: 35px; 
 
    height: 30px; 
 
    left: 10px; 
 
    top: 5px; 
 
    z-index: 500000; 
 
} 
 
.wrap .burger .burger_inside { 
 
    position: absolute; 
 
    background-color: #222; 
 
    width: 30px; 
 
    height: 5px; 
 
    left: 2.5px; 
 
    -webkit-transition: all 0.5s ease-out; 
 
    -moz-transition: all 0.5s ease-out; 
 
    -ms-transition: all 0.5s ease-out; 
 
    -o-transition: all 0.5s ease-out; 
 
    transition: all 0.5s ease-out; 
 
} 
 
.wrap .burger #bgrOne { 
 
    top: 0; 
 
} 
 
.wrap .burger #bgrTwo { 
 
    top: 10px; 
 
} 
 
.wrap .burger #bgrThree { 
 
    top: 20px; 
 
} 
 
.wrap #side-menu { 
 
    position: absolute; 
 
    z-index: -1; 
 
    background: #404040; 
 
    width: 22em; 
 
    padding-top: 40px; 
 
    padding-right: 20px; 
 
    padding-left: 10px; 
 
    float: left; 
 
    display: block; 
 
    left: 0; 
 
    height: 900px; 
 
} 
 
.wrap .content { 
 
    position: absolute; 
 
    right: 0; 
 
    min-width: 400px; 
 
    -webkit-transition: all 0.3s ease-out; 
 
    -moz-transition: all 0.3s ease-out; 
 
    -ms-transition: all 0.3s ease-out; 
 
    -o-transition: all 0.3s ease-out; 
 
    transition: all 0.3s ease-out; 
 
} 
 
.wrap .content .top-bar { 
 
    height: 40px; 
 
    background: #ddd; 
 
} 
 
.wrap .content .content-inner { 
 
    padding: 0; 
 
    margin: 0; 
 
    background: #fff; 
 
    padding-left: 20px; 
 
    display: block; 
 
    position: absolute; 
 
    height: 900px; 
 
    width: 100%; 
 
} 
 
.wrap ul.accordion { 
 
    width: 100%; 
 
    background: transparent; 
 
} 
 
.wrap ul.accordion .link { 
 
    cursor: pointer; 
 
    display: block; 
 
    padding: 15px 15px 15px 42px; 
 
    color: #9D9D9D; 
 
    font-size: 14px; 
 
    font-weight: 700; 
 
    border-bottom: 1px solid #303030; 
 
    position: relative; 
 
    -webkit-transition: all 0.4s ease; 
 
    -o-transition: all 0.4s ease; 
 
    transition: all 0.4s ease; 
 
} 
 
.wrap ul.accordion li:not(open) last-child .link { 
 
    border-bottom: 0; 
 
} 
 
.wrap ul.accordion li i { 
 
    position: absolute; 
 
    top: 16px; 
 
    left: 12px; 
 
    font-size: 18px; 
 
    color: #999; 
 
    -webkit-transition: all 0.4s ease; 
 
    -o-transition: all 0.4s ease; 
 
    transition: all 0.4s ease; 
 
} 
 
.wrap ul.accordion li i.fa-chevron-down { 
 
    right: 12px; 
 
    left: auto; 
 
    font-size: 16px; 
 
} 
 
.wrap ul.accordion li.open .link { 
 
    color: #FFB266; 
 
} 
 
.wrap ul.accordion li.open i { 
 
    color: #FFB266; 
 
} 
 
.wrap ul.accordion li.open i.fa-chevron-down { 
 
    -webkit-transform: rotate(180deg); 
 
    -ms-transform: rotate(180deg); 
 
    -o-transform: rotate(180deg); 
 
    transform: rotate(180deg); 
 
} 
 
.wrap ul.accordion ul.submenu { 
 
    display: none; 
 
    background: transparent; 
 
    font-size: 14px; 
 
    padding: 0; 
 
} 
 
.wrap ul.accordion ul.submenu li { 
 
    border-bottom: 1px solid #4b4a5e; 
 
    list-style: none; 
 
} 
 
.wrap ul.accordion ul.submenu li a { 
 
    display: block; 
 
    text-decoration: none; 
 
    color: #d9d9d9; 
 
    padding: 12px; 
 
    padding-left: 42px; 
 
    -webkit-transition: all 0.25s ease; 
 
    -o-transition: all 0.25s ease; 
 
    transition: all 0.25s ease; 
 
} 
 
.wrap ul.accordion ul.submenu li a:hover { 
 
    background: rgba(240, 128, 128, 0.8); 
 
    color: #ffb266; 
 
} 
 
@media screen and (max-width: 768px) { 
 
    .wrap .nav-bar .navbar-brand { 
 
    margin-top: 0; 
 
    padding-left: 0; 
 
    } 
 
    .wrap .side-menu-link { 
 
    display: inline-block; 
 
    } 
 
    .wrap #side-menu #qform { 
 
    position: absolute; 
 
    top: 10px; 
 
    } 
 
    .wrap .content { 
 
    left: 0; 
 
    } 
 
    .wrap.active .content { 
 
    left: 21em; 
 
    } 
 
    .wrap.active .content #bgrOne { 
 
    top: 10px; 
 
    transform: rotate(225deg); 
 
    } 
 
    .wrap.active .content #bgrTwo { 
 
    opacity: 0; 
 
    } 
 
    .wrap.active .content #bgrThree { 
 
    top: 10px; 
 
    transform: rotate(315deg); 
 
    } 
 
} 
 
@media screen and (min-width: 769px) { 
 
    .side-menu-link { 
 
    display: none; 
 
    } 
 
    .wrap { 
 
    position: relative; 
 
    } 
 
    .wrap .content { 
 
    left: 21em; 
 
    right: 0; 
 
    } 
 
} 
 

 
    </style> 
 
    <script src="//code.jquery.com/jquery-1.10.2.min.js"></script> 
 
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> 
 
    <script type="text/javascript"> 
 
     window.alert = function(){}; 
 
     var defaultCSS = document.getElementById('bootstrap-css'); 
 
     function changeCSS(css){ 
 
      if(css) $('head > link').filter(':first').replaceWith('<link rel="stylesheet" href="'+ css +'" type="text/css" />'); 
 
      else $('head > link').filter(':first').replaceWith(defaultCSS); 
 
     } 
 
     $(document).ready(function() { 
 
      var iframe_height = parseInt($('html').height()); 
 
      window.parent.postMessage(iframe_height, 'https://bootsnipp.com'); 
 
     }); 
 
    </script> 
 
</head> 
 
<body> 
 
<!-- <body style="visibility: hidden !important;"> 
 
\t <div id="babasbmsgx" style="visibility: visible !important;">Please disable your adblock and script blockers to view this page</div>--> 
 

 
\t <div class="wrap"> 
 
    <nav class="nav-bar navbar-inverse" role="navigation"> 
 
     <div id ="top-menu" class="container-fluid active"> 
 
      <a class="navbar-brand" href="#">AntiMalwareProgram</a> 
 
      <ul class="nav navbar-nav">   
 
\t \t \t 
 
       <form id="qform" class="navbar-form pull-left" method="get" action="https://www.google.com/search" role="search"> 
 
       <input type="text" class="form-control" name="q" 
 
    type="submit" placeholder="Search all of Google!" />       
 
       </form> 
 

 
       <li class="dropdown movable"> 
 
\t \t \t \t \t \t \t    <img id="fa fa-4x fa-child" src="" > 
 

 
        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="caret"></span><span class="fa fa-4x fa-child"></span></a> 
 
        <ul class="dropdown-menu" role="menu"> 
 
        <li><a href="https://www.authpro.com/auth/antimalwareprogram/?action=edit "><span class="fa fa-user"></span>Edit Profile</a></li> 
 
         <li><a href="https://www.authpro.com/auth/antimalwareprogram/?action=del "><span class="fa fa-gear"></span>Cancel Account</a></li> 
 
         <li class="divider"></li> 
 
         <li><a href="https://www.authpro.com/auth/antimalwareprogram/?action=logout 
 
"><span class="fa fa-power-off"></span>Log Out</a></li> 
 
        </ul> 
 
       </li> 
 
       
 
      </ul> 
 
     </div>  
 
    </nav> 
 
    <aside id="side-menu" class="aside" role="navigation">    
 
     <ul class="nav nav-list accordion">      
 
      <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-lg fa-globe"></i>Current pages<i class="fa fa-chevron-down"></i></div> 
 
      <ul class="submenu"> 
 
       <li><a href="#">About Current Pages(You Are Here)</a></li> 
 
       <li><a href="https://antimalwareprogram.co/joomla/index.php">Joomla Pages</a></li> 
 
\t \t \t <li><a href="https://antimalwareprogram.co/wordpress/">Blogs</a></li> 
 
\t \t \t <li><a href="https://antimalwareprogram.co/wiki/doku.php?id=wiki:welcome">Community Editable Wiki</a></li> 
 

 

 
\t \t \t 
 
      </ul> 
 
      </li> 
 
      
 
      <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-lg fa-users"></i>Users<i class="fa fa-chevron-down"></i></div> 
 
      <ul class="submenu"> 
 
       <li><a href="https://www.authpro.com/auth/antimalwareprogram/?action=edit">Edit Profile</a></li> 
 
       <li><a href="https://www.authpro.com/auth/antimalwareprogram/?action=del">Cancel Account</a></li> 
 
      </ul> 
 
      </li> 
 
      
 
      <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-cloud"></i>Forms<i class="fa fa-chevron-down"></i></div> 
 
      <ul class="submenu"> 
 
\t \t <li><a href="https://antimalwareprogram.co/Support_Tickets=true&active=true">Submit a support ticket</a></li> 
 
       <li><a href="https://antimalwareprogram.co/Feedback_Survey">Feedback Survey</a></li> 
 
       <li><a href="https://antimalwareprogram.co/Vote_For_Content">Vote For Content</a></li> 
 
       <li><a href="https://antimalwareprogram.co/Contact_Us">Contact Us</a></li> 
 
      </ul> 
 
      </li> 
 
      
 
      <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-lg fa-map-marker"></i>Go Back/Forward Buttons<i class="fa fa-chevron-down"></i></div> 
 
      <ul class="submenu"> 
 
\t \t <li><a onclick="goBack()">Go Back</a></li> 
 
\t \t <li><a onclick="goForward()">Go Forward</a></li> 
 

 

 

 

 
      </ul> 
 
      </li> 
 
      
 
      <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-lg fa-file-image-o"></i>Other<i class="fa fa-chevron-down"></i></div> 
 

 
      <ul class="submenu"> 
 
       <li><a href="https://antimalwareprogram.co/What's_New.php">What's New?</a></li> 
 
\t \t \t <li><a href="https://antimalwareprogram.co/copyright_notice.php">&copy; 2016-<?php echo date("Y");?></a></li> 
 
       <li><a href="/Mailing_List">Our Mailing List</a></li> 
 
       <li><a href="#">Comming Soon</a></li>   
 
       <li><a href="#">Comming Soon</a></li> 
 

 

 
      </ul> 
 
      </li> 
 
\t \t <li class="nav-header"> 
 
      <div class="link"><i class="fa fa-lg fa-file-image-o"></i>AntiMalwareProgram!<i class="fa fa-chevron-down"></i></div> 
 
      <ul class="submenu"> 
 
       <li><a href="/results.html">Results</a></li> 
 
       <li><a href="/dashboard">Dashboard</a></li>   
 
       <li><a href="/test-malware.html">Malware Test</a></li> 
 

 

 
      </ul> 
 
      </li> 
 
      <img id="myImg" src="https://antimalwareprogram.co/RapidSSL_SEAL-90x50.gif" alt="Rapid SSL Image" width="100%" height="100"> 
 

 
     </ul> 
 
    </aside> 
 

 
    <!--Body content--> 
 
    <div class="content"> 
 
    <div class="top-bar">  
 
     <a href="#menu" class="side-menu-link burger"> 
 
     <span class='burger_inside' id='bgrOne'></span> 
 
     <span class='burger_inside' id='bgrTwo'></span> 
 
     <span class='burger_inside' id='bgrThree'></span> 
 
     </a>  
 
    </div> 
 
    <section class="content-inner"> 
 
\t <script> 
 
function goBack() { 
 
    window.history.back(); 
 
} 
 
</script> 
 
\t <script> 
 
function goForward() { 
 
    window.history.forward(); 
 
} 
 
</script> 
 
\t <!DOCTYPE html> 
 
<html> 
 
<head> 
 
<style> 
 
#myImg { 
 
    border-radius: 5px; 
 
    cursor: pointer; 
 
    transition: 0.3s; 
 
} 
 

 
#myImg:hover {opacity: 0.7;} 
 

 
/* The Modal (background) */ 
 
.modal { 
 
    display: none; /* Hidden by default */ 
 
    position: fixed; /* Stay in place */ 
 
    z-index: 1; /* Sit on top */ 
 
    padding-top: 100px; /* Location of the box */ 
 
    left: 0; 
 
    top: 0; 
 
    width: 100%; /* Full width */ 
 
    height: 100%; /* Full height */ 
 
    overflow: auto; /* Enable scroll if needed */ 
 
    background-color: rgb(0,0,0); /* Fallback color */ 
 
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */ 
 
} 
 

 
/* Modal Content (image) */ 
 
.modal-content { 
 
    margin: auto; 
 
    display: block; 
 
    width: 80%; 
 
    max-width: 700px; 
 
} 
 

 
/* Caption of Modal Image */ 
 
#caption { 
 
    margin: auto; 
 
    display: block; 
 
    width: 80%; 
 
    max-width: 700px; 
 
    text-align: center; 
 
    color: #ccc; 
 
    padding: 10px 0; 
 
    height: 150px; 
 
} 
 

 
/* Add Animation */ 
 
.modal-content, #caption {  
 
    -webkit-animation-name: zoom; 
 
    -webkit-animation-duration: 0.6s; 
 
    animation-name: zoom; 
 
    animation-duration: 0.6s; 
 
} 
 

 
@-webkit-keyframes zoom { 
 
    from {-webkit-transform:scale(0)} 
 
    to {-webkit-transform:scale(1)} 
 
} 
 

 
@keyframes zoom { 
 
    from {transform:scale(0)} 
 
    to {transform:scale(1)} 
 
} 
 

 
/* The Close Button */ 
 
.close { 
 
    position: absolute; 
 
    top: 15px; 
 
    right: 35px; 
 
    color: #f1f1f1; 
 
    font-size: 40px; 
 
    font-weight: bold; 
 
    transition: 0.3s; 
 
} 
 

 
.close:hover, 
 
.close:focus { 
 
    color: #bbb; 
 
    text-decoration: none; 
 
    cursor: pointer; 
 
} 
 

 
/* 100% Image Width on Smaller Screens */ 
 
@media only screen and (max-width: 700px){ 
 
    .modal-content { 
 
     width: 100%; 
 
    } 
 
} 
 
</style> 
 

 
    
 
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> 
 
<script> 
 
    (adsbygoogle = window.adsbygoogle || []).push({ 
 
    google_ad_client: "ca-pub-7824087727433149", 
 
    enable_page_level_ads: true 
 
    }); 
 
</script> 
 
    
 
    
 
    <!-- Google Code for antimalwareprogram.co Conversion Page --> 
 
<script type="text/javascript"> 
 
/* <![CDATA[ */ 
 
var google_conversion_id = 934367017; 
 
var google_conversion_language = "en"; 
 
var google_conversion_format = "3"; 
 
var google_conversion_color = "ffffff"; 
 
var google_conversion_label = "PWD9CPGJ13MQqZ7FvQM"; 
 
var google_remarketing_only = false; 
 
/* ]]> */ 
 
</script> 
 
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> 
 
</script> 
 
<noscript> 
 
<div style="display:inline;"> 
 
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/934367017/?label=PWD9CPGJ13MQqZ7FvQM&amp;guid=ON&amp;script=0"/> 
 
</div> 
 
</noscript> 
 
<ul class='custom-menu'> 
 
    <li data-action = "first">First thing</li> 
 
    <li data-action = "second">Second thing</li> 
 
    <li data-action = "third">Third thing</li> 
 
</ul> 
 
    <style> 
 
\t .custom-menu { 
 
    display: none; 
 
    z-index: 1000; 
 
    position: absolute; 
 
    overflow: hidden; 
 
    border: 1px solid #CCC; 
 
    white-space: nowrap; 
 
    font-family: sans-serif; 
 
    background: #FFF; 
 
    color: #333; 
 
    border-radius: 5px; 
 
} 
 

 
.custom-menu li { 
 
    padding: 8px 12px; 
 
    cursor: pointer; 
 
} 
 

 
.custom-menu li:hover { 
 
    background-color: #DEF; 
 
} 
 
    </style> 
 
    <script> 
 
\t 
 
<!-- 
 
This code is developed by Anand Roshan for www.voidtricks.com tutorial 
 
Tutorial URI : http://www.voidtricks.com/custom-right-click-context-menu/ 
 
--> 
 
<!DOCTYPE html> 
 
<html> 
 
<head> 
 
\t <style type="text/css"> 
 
\t \t .menu{ 
 
\t \t \t width: 100px; 
 
\t \t \t background: #000; 
 
\t \t \t color: #fff; 
 
\t \t \t position:absolute; 
 
\t \t \t z-index: 999999; 
 
\t \t \t display: none; 
 
\t \t \t box-shadow: 0 0 10px #713C3C; 
 
\t \t } 
 
\t \t .menu ul{ 
 
\t \t \t list-style: none; 
 
\t \t \t padding: 0; 
 
\t \t \t margin:0; 
 
\t \t } 
 
\t \t .menu ul a{ 
 
\t \t \t text-decoration: none; 
 
\t \t } 
 
\t \t .menu ul li{ 
 
\t \t \t width: 100%%; 
 
\t \t \t padding: 6%; 
 
\t \t \t background-color: #F04D44; 
 
\t \t \t color: #fff; 
 
\t \t } 
 
\t \t .menu ul li:hover{ 
 
\t \t \t background-color: grey; 
 
\t  \t \t color: red; 
 
\t \t } 
 
\t </style> 
 
\t <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script> 
 
\t <script type="text/javascript"> 
 
\t $(document).ready(function() { 
 
\t \t $("html").on("contextmenu",function(e){ 
 
\t \t  //prevent default context menu for right click 
 
\t \t  e.preventDefault(); 
 

 
\t \t  var menu = $(".menu"); 
 

 
\t \t  //hide menu if already shown 
 
\t \t  menu.hide(); 
 
\t \t   
 
\t \t  //get x and y values of the click event 
 
\t \t  var pageX = e.pageX; 
 
\t \t  var pageY = e.pageY; 
 

 
\t \t  //position menu div near mouse cliked area 
 
\t \t  menu.css({top: pageY , left: pageX}); 
 

 
\t \t  var mwidth = menu.width(); 
 
\t \t  var mheight = menu.height(); 
 
\t \t  var screenWidth = $(window).width(); 
 
\t \t  var screenHeight = $(window).height(); 
 

 
\t \t  //if window is scrolled 
 
\t \t  var scrTop = $(window).scrollTop(); 
 

 
\t \t  //if the menu is close to right edge of the window 
 
\t \t  if(pageX+mwidth > screenWidth){ 
 
\t \t   \t menu.css({left:pageX-mwidth}); 
 
\t \t  } 
 

 
\t \t  //if the menu is close to bottom edge of the window 
 
\t \t  if(pageY+mheight > screenHeight+scrTop){ 
 
\t \t   \t menu.css({top:pageY-mheight}); 
 
\t \t  } 
 

 
\t \t  //finally show the menu 
 
\t \t  menu.show(); 
 
\t \t }); 
 
\t \t 
 
\t \t $("html").on("click", function(){ 
 
\t \t \t $(".menu").hide(); 
 
\t \t }); 
 
\t }); 
 
\t </script> 
 
\t 
 
</head> 
 
<body> 
 
<!-- Menu div initially hidden --> 
 
<div class="menu"> 
 
\t <ul> 
 
\t \t <li><a href="https://antimalwareprogram.co/pages.php">Home</a></li> 
 
<li><a href="https://antimalwareprogram.co/dashboard.html">Main Dashboard</a></li> 
 
<li><a href="https://antimalwareprogram.co/Mailing_List">Newsletter</a></li> 
 
<li><a href="https://antimalwareprogram.co/Feedback_Survey">Feedback</a></li> 
 
    <li><a href="https://antimalwareprogram.co/Contact_Us">Contact Us</a></li> 
 
\t </ul> 
 
</div> 
 
</body> 
 
</html> 
 
    
 
    
 
<!-- 
 
This code is developed by Anand Roshan for www.voidtricks.com tutorial 
 
Tutorial URI : http://www.voidtricks.com/custom-right-click-context-menu/ 
 
--> 
 
<!DOCTYPE html> 
 
\t <script> 
 
\t ; 
 
\t </script> 
 
<html> 
 
<head> 
 
\t <title>Custom Right Click Menu</title> 
 
\t <style type="text/css"> 
 
\t \t .menu{ 
 
\t \t \t width: 300px; 
 
\t \t \t background: #000; 
 
\t \t \t color: #fff; 
 
\t \t \t position:absolute; 
 
\t \t \t z-index: 999999; 
 
\t \t \t display: none; 
 
\t \t \t box-shadow: 0 0 10px #713C3C; 
 
\t \t } 
 
\t \t .menu ul{ 
 
\t \t \t list-style: none; 
 
\t \t \t padding: 0; 
 
\t \t \t margin:0; 
 
\t \t } 
 
\t \t .menu ul a{ 
 
\t \t \t text-decoration: none; 
 
\t \t } 
 
\t \t .menu ul li{ 
 
\t \t \t width: 88%; 
 
\t \t \t padding: 6%; 
 
\t \t \t background-color: transparent; 
 
\t \t \t color: #fff; 
 
\t \t } 
 
\t \t .menu ul li:hover{ 
 
\t \t \t background-color: grey; 
 
\t  \t \t color: white; 
 
\t \t } 
 
\t </style> 
 
\t <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script> 
 
\t <script type="text/javascript"> 
 
\t $(document).ready(function() { 
 
\t \t $("html").on("contextmenu",function(e){ 
 
\t \t  //prevent default context menu for right click 
 
\t \t  e.preventDefault(); 
 

 
\t \t  var menu = $(".menu"); 
 

 
\t \t  //hide menu if already shown 
 
\t \t  menu.hide(); 
 
\t \t   
 
\t \t  //get x and y values of the click event 
 
\t \t  var pageX = e.pageX; 
 
\t \t  var pageY = e.pageY; 
 

 
\t \t  //position menu div near mouse cliked area 
 
\t \t  menu.css({top: pageY , left: pageX}); 
 

 
\t \t  var mwidth = menu.width(); 
 
\t \t  var mheight = menu.height(); 
 
\t \t  var screenWidth = $(window).width(); 
 
\t \t  var screenHeight = $(window).height(); 
 

 
\t \t  //if window is scrolled 
 
\t \t  var scrTop = $(window).scrollTop(); 
 

 
\t \t  //if the menu is close to right edge of the window 
 
\t \t  if(pageX+mwidth > screenWidth){ 
 
\t \t   \t menu.css({left:pageX-mwidth}); 
 
\t \t  } 
 

 
\t \t  //if the menu is close to bottom edge of the window 
 
\t \t  if(pageY+mheight > screenHeight+scrTop){ 
 
\t \t   \t menu.css({top:pageY-mheight}); 
 
\t \t  } 
 

 
\t \t  //finally show the menu 
 
\t \t  menu.show(); 
 
\t \t 
 
\t \t $("html").on("click", function(){ 
 
\t \t \t $(".menu").hide(); 
 
\t \t }); 
 
\t }); 
 
\t </script> 
 
\t 
 
</head> 
 
<body> 
 
<!-- Menu div initially hidden --> 
 
<div class="menu"> 
 
\t <ul> 
 
\t 
 
\t </ul> 
 
</div> 
 

 

 
\t </section> 
 
    </div> 
 
    
 
</div> 
 
\t <script type="text/javascript"> 
 
\t $(function() { 
 
    var accordionActive = false; 
 
    
 
    $(window).on('resize', function() { 
 
     var windowWidth = $(window).width(); 
 
     var $topMenu = $('#top-menu'); 
 
     var $sideMenu = $('#side-menu');  
 
     
 
     if (windowWidth < 768) { 
 
      if ($topMenu.hasClass("active")) {    
 
      $topMenu.removeClass("active"); 
 
      $sideMenu.addClass("active"); 
 
      
 
      var $ddl = $('#top-menu .movable.dropdown'); 
 
      $ddl.detach(); 
 
      $ddl.removeClass('dropdown'); 
 
      $ddl.addClass('nav-header'); 
 
      
 
      $ddl.find('.dropdown-toggle').removeClass('dropdown-toggle').addClass('link'); 
 
      $ddl.find('.dropdown-menu').removeClass('dropdown-menu').addClass('submenu'); 
 
         
 
      $ddl.prependTo($sideMenu.find('.accordion')); 
 
      $('#top-menu #qform').detach().removeClass('navbar-form').prependTo($sideMenu); 
 
      
 
      if (!accordionActive) { 
 
       var Accordion2 = function(el, multiple) { 
 
       this.el = el || {}; 
 
       this.multiple = multiple || false; 
 

 
        // Variables privadas 
 
       var links = this.el.find('.movable .link'); 
 
       // Evento 
 
       links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); 
 
       } 
 

 
       Accordion2.prototype.dropdown = function(e) { 
 
       var $el = e.data.el; 
 
       $this = $(this), 
 
        $next = $this.next(); 
 

 
       $next.slideToggle(); 
 
       $this.parent().toggleClass('open'); 
 

 
       if (!e.data.multiple) { 
 
        $el.find('.movable .submenu').not($next).slideUp().parent().removeClass('open'); 
 
       }; 
 
       }  
 

 
       var accordion = new Accordion2($('ul.accordion'), false); 
 
       accordionActive = true; 
 
      } 
 
      } 
 
     } 
 
     else { 
 
      if ($sideMenu.hasClass("active")) {    
 
      $sideMenu.removeClass('active'); 
 
      $topMenu.addClass('active'); 
 
      
 
      var $ddl = $('#side-menu .movable.nav-header'); 
 
      $ddl.detach(); 
 
      $ddl.removeClass('nav-header'); 
 
      $ddl.addClass('dropdown'); 
 
      
 
      $ddl.find('.link').removeClass('link').addClass('dropdown-toggle'); 
 
      $ddl.find('.submenu').removeClass('submenu').addClass('dropdown-menu'); 
 
      
 
      $('#side-menu #qform').detach().addClass('navbar-form').appendTo($topMenu.find('.nav')); 
 
      $ddl.appendTo($topMenu.find('.nav')); 
 
      } 
 
     } 
 
    }); 
 
    
 
    /**/ 
 
    var $menulink = $('.side-menu-link'),  
 
     $wrap = $('.wrap'); 
 
    
 
    $menulink.click(function() {  
 
    $menulink.toggleClass('active'); 
 
    $wrap.toggleClass('active');  
 
    return false; 
 
    }); 
 
    
 
    /*Accordion*/ 
 
    var Accordion = function(el, multiple) { 
 
    this.el = el || {}; 
 
    this.multiple = multiple || false; 
 

 
    // Variables privadas 
 
    var links = this.el.find('.link'); 
 
    // Evento 
 
    links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); 
 
    } 
 

 
    Accordion.prototype.dropdown = function(e) { 
 
    var $el = e.data.el; 
 
    $this = $(this), 
 
     $next = $this.next(); 
 

 
    $next.slideToggle(); 
 
    $this.parent().toggleClass('open'); 
 

 
    if (!e.data.multiple) { 
 
     $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); 
 
    }; 
 
    } \t 
 

 
    var accordion = new Accordion($('ul.accordion'), false); 
 
    
 
    
 
}); 
 
\t </script> 
 
\t 
 
</body> 
 
    
 

 
    
 
</html> 
 

 

 
\t \t </section> 
 
\t </div> 
 
\t 
 
\t <footer> 
 
\t \t <hr /> 
 
\t \t 
 
\t <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
 
\t <script>window.jQuery || document.write('<script src="http://manos.malihu.gr/repository/js/minified/jquery-1.11.0.min.js"><\/script>')</script> 
 
\t 
 
\t <!-- custom scrollbar plugin --> 
 
\t <script src="http://manos.malihu.gr/repository/custom-scrollbar/demo/jquery.mCustomScrollbar.concat.min.js"></script> 
 
\t 
 
\t <script> 
 
\t \t (function($){ 
 
\t \t \t $(window).on("load",function(){ 
 
\t \t \t \t 
 
\t \t \t \t $("body").mCustomScrollbar({ 
 
\t \t \t \t \t theme:"minimal" 
 
\t \t \t \t }); 
 
\t \t \t \t 
 
\t \t \t }); 
 
\t \t })(jQuery); 
 
\t </script> 
 
</body> 
 
</html>

+0

にエラーposition absoluteた_minimal_再生を提供してください...あなた」ここにウェブサイト全体を貼り付けました。 [MCVEの作成に関するガイド](https://stackoverflow.com/help/mcve)を参照してください。 –

+0

@LazarLjubenovićどの部分がエラーなのかわからないので、私は選択せずにやった、私は長さの制限にいくつかを削除する必要がありました! –

+0

少しずつ削除を開始すると、MVCEに最終的に到着します。あなたがそうしている間にあなた自身が誤りを理解し、道に沿っていくつかのことを学ぶことが起こるかもしれません。私たちはここに助けを求めています。ウェブページ全体を通してあなたのための仕事をしません。 –

答えて

0

を作成して、問題は、CSS

+0

あなたの問題を解決するために変更する必要がある 'position:absolute'を指定できる方が良いでしょう。それは、この記事を見つけて同様の問題を抱えている人に、その答えをより有用にするでしょう。 – Jonathan

+0

あなた自身の答えを検証し、できればそれをもう少し詳しく説明するので、最終的に他人を助けることができます。 – Fabien

関連する問題