我完全没有使用html的经验。我有一个预先制作的电子商务网页与Jumpseller.
下拉菜单"productos“将不会显示。您只能单击"productos“并转到特定页面。
这是导航菜单的“代码”。
<li class="nav-item {% if item.dropdown %}dropdown{% endif %} {% if active_items contains item.id %}active{% endif %}">
<a href="{{ item.url }}" {% if item.external %}target="_blank"{% endif %} title="{{item.name}}" class="{% if item.dropdown%}dropdown-toggle {% endif %}level-1 nav-link" {% if item.dropdown %}data-toggle=""{% endif %}>{{ item.name }}</a>
{% if item.dropdown %}
<ul class="dropdown-menu multi-level">
{% for item in item.items %}
{% include 'navigation_menu' with item %}
{% endfor %}
</ul>
{% endif %}
</li>这是主页的代码所在的下拉菜单"productos“。
<!-- Slider Section-->
{% include 'slider_home' %}
<!-- Features Section -->
{% include 'features_home' %}
<div class="container principal">
<!-- Banners Section -->
{% include 'banners_home' %}
{% case options.products_home %}
{% when "featured-home" or "latest-and-featured-home" %}
<!-- Featured Products Section -->
<div class="row section">
<div class="col-12"><h2 class="section-title">{% t 'Featured Products' %}</h2></div>
{% if products.all == empty %}
<div class="owl-carousel">
{% assign placeholders = "1,2,3,4" | split: "," %}
{% for placeholder in placeholders %}
<div class="no-product item">
<div class="product-block">
<div style="background-image: url('{{ 'no-image-home.png' | asset }}');"></div>
<div class="caption">
<a href="{{store.url}}/admin/products/new" class="butn">{% t 'Add products' %}</a>
<span class="product-block-list">$0.00</span>
</div>
</div>
</div>
{% endfor %}
</div>
{%else%}
<!-- Featured Products -->
<div class="owl-carousel">
{% for product in products.featured limit:options.products_featured_limit %}
<div class="item">
{% include 'list_product' with product %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% when "latest-home" or "latest-and-featured-home" %}
<!-- Latest Products Section -->
<div class="row section">
<div class="col-12"><h2 class="section-title">{% t 'Latest Products' %}</h2></div>
{% if products.all == empty %}
<div class="owl-carousel">
{% assign placeholders = "1,2,3,4" | split: "," %}
{% for placeholder in placeholders %}
<div class="no-product item">
<div class="product-block">
<a href="{{store.url}}/admin/products/new" class="product-image">
<div style="background-image: url('{{ 'no-image-home.png' | asset }}');"></div>
</a>
<div class="caption">
<a href="{{store.url}}/admin/products/new" class="butn butn-block">{% t 'Add products' %}</a>
<div class="list-price mt-2">
<span class="product-block-list">$0.00</span>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{%else%}
<div class="owl-carousel">
{% for product in products.latest limit:options.products_home_limit %}
<div class="item">
{% include 'list_product' with product %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% when "not-display"%}
{% endcase%}
{% if options.featured_category_home_1 != blank %}
<!-- Category Products Carousel Section 1 -->
{% assign cat = store.category[options.featured_category_home_1] %}
{% if cat.products.count != 0 %}
<div class="row section">
<div class="col-12"><h2 class="section-title">{{ cat.name }}</h2></div>
<div class="owl-carousel">
{% for product in cat.products %}
<div class="item">
{% include 'list_product' with product %}
</div>
{% endfor %}
</div>
<div class="col-12 button-footer">
<a href="{{ cat.url }}" title="View all {{ cat.name }}" class="butn">{% t 'View all' %}</a>
</div>
</div>
{% endif %}
{% endif %}
{% if options.featured_category_home_2 != blank%}
<!-- Category Products Carousel Section 2 -->
{% assign cat = store.category[options.featured_category_home_2] %}
{% if cat.products.count != 0 %}
<div class="row section">
<div class="col-12"><h2 class="section-title">{{ cat.name }}</h2></div>
<div class="owl-carousel">
{% for product in cat.products %}
<div class="item">
{% include 'list_product' with product %}
</div>
{% endfor %}
</div>
<div class="col-12 button-footer">
<a href="{{ cat.url }}" title="View all {{ cat.name }}" class="butn">{% t 'View all' %}</a>
</div>
</div>
{% endif %}
{% endif %}
{% if options.featured_category_home_3 != blank%}
<!-- Category Products Carousel Section 3 -->
{% assign cat = store.category[options.featured_category_home_3] %}
{% if cat.products.count != 0 %}
<div class="row section">
<div class="col-12"><h2 class="section-title">{{ cat.name }}</h2></div>
<div class="owl-carousel">
{% for product in cat.products %}
<div class="item">
{% include 'list_product' with product %}
</div>
{% endfor %}
</div>
<div class="col-12 button-footer">
<a href="{{ cat.url }}" title="View all {{ cat.name }}" class="butn">{% t 'View all' %}</a>
</div>
</div>
{% endif %}
{% endif %}
{% if options.home_page_blog %}
<!-- Blog Home -->
<div id="blog-list" class="row section">
<div class="col-12"><h2 class="section-title">{% t 'Blog' %}</h2></div>
{% unless pages.categories.category["Post"] == blank %}
{% paginate pages.categories.category["Post"].pages by options.page_post_per_page reversed %}
{% for page in paged.pages reversed %}
{% if forloop.index0 == 4 %}{% break %}{% endif %}
<div class="col-sm-6 col-12">
<div class="row block-post no-gutters">
<div class="col-md-6 col-12">
<a href="{{ page.url }}" title="{{ page.title }}" class="butn wi"><i class='linear-icon icon-0166-eye'></i>{% t 'Read More' %}</a>
<a href="{{ page.url }}" title="{{ page.title }}">
{% if page.images == empty %}
<div class="blog-image" style="background-image: url('https://placehold.it/320x275')"></div>
{% else %}
<div class="blog-image" style="background-image: url('{{ page.images.first }}')"></div>
{% endif %}
</a>
</div>
<div class="col-md-6 col-12">
<div class="inner">
<a href="{{ page.url }}" title="{{ page.title }}"><h3>{{ page.title }}</h3></a>
{% if page.body != blank%}<p>{{ page.body | strip_html | truncate: 210 }}</p>{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
<div class="col-12 button-footer">
<a href="blog" title="Blog" class="butn">{% t 'Go to Blog' %}</a>
{% endpaginate %}
{% endunless %}
</div>
</div>
{% endif %}
</div>
{% if options.instafeed and social.instagram_url != blank %}
<!-- Instagram widget -->
<div class="container-fluid">
<div class="row">
<div class="col-12"><h2 class="section-title">Instagram</h2></div>
<div id="instagram" class="col-12 limit-{{ options.instagram-limit }}">
{% capture follow_us_translation %}{% t "Follow Us" %}{% endcapture %}
<span><a href="{{ social.instagram_url }}" target="_blank" title="{{follow_us_translation}} @{{ social.instagram_url | split: '/' | last }}" class="butn"><i class="fab fa-instagram" aria-hidden="true"></i> {{ follow_us_translation }}</a></span>
</div>
</div>
</div>
<!-- Instagram code -->
<script>
$.ajax({
url: "/instagram-app/media",
data: {
count: {% if options.instagram-limit %}{{ options.instagram-limit }}{% else %}10{% endif %}
},
success: function(json) {
for (var i in json.posts) {
if(i >= {% if options.instagram-limit %}{{ options.instagram-limit }}{% else %}10{% endif %}){continue};
url = json.posts[i].thumbnail_url;
shortcode = json.posts[i].shortcode;
newElement = document.createElement('div');
newElement.className = 'insta_img';
newElement.style = 'background-image: url(' + url + ')';
newElementLink = document.createElement('a');
newElementLink.href = json.posts[i].permalink;
newElementLink.target = "_blank";
newElementLink.appendChild(newElement);
var clientHeight = document.getElementById('instagram').clientHeight;
document.getElementById("instagram").appendChild(newElementLink);
}
}
});
</script>
{% endif %}
<script>
function parse_str(str) {
return str.split('&').reduce(function(params, param) {
var paramSplit = param.split('=').map(function(value) {
return decodeURIComponent(value.replace('+', ' '));
});
params[paramSplit[0]] = paramSplit[1];
return params;
}, {});
}
</script>
></div>发布于 2020-08-24 06:32:16
带有products的菜单项包含一个链接,单击该链接可转到另一个页面,因此通过悬停鼠标光标显示下拉菜单更符合逻辑。我为你制定了这条规则。只需将其粘贴到您的样式中,在<style>...</style>标记内。如果你有任何困难,请在评论中提到这里。
.nav-item.dropdown:hover ul.dropdown-menu.multi-level {
display: block;
}https://stackoverflow.com/questions/63552244
复制相似问题