小编use*_*844的帖子

如何隐藏其他标签的内容并仅显示所选标签的内容

我的HTML是

function showStuff(id) {
  if (document.getElementById(id).style.display === "block") {
    document.getElementById(id).style.display = "none";
  } else {
    document.getElementById(id).style.display = "block";
  }
}
Run Code Online (Sandbox Code Playgroud)

而JavaScript则是

<ul class="side bar tabs">
  <li id="tabs1" onclick="showStuff('tabs-1')">City</li>
  <li id="tabs2" onclick="showStuff('tabs-2')">Country</li>
  <li id="tabs3" onclick="showStuff('tabs-3')">Humanity</li>
</ul>

<div id="tabs-1" style="display : none">
  <p>Proin elit m</p>
</div>
<div id="tabs-2" style="display : none">
  <p>M massa ut d</p>
</div>
<div id="tabs-3" style="display : none">
  <p> sodales.</p>
</div>
Run Code Online (Sandbox Code Playgroud)

当我单击特定选项卡时,其他选项卡的内容应该被隐藏但不隐藏.这是我的所有代码.

html javascript css user-interface tabs

4
推荐指数
1
解决办法
4万
查看次数

找不到页(404)

错误是:

Page not found (404)
Request Method: GET
Request URL:    'http://127.0.0.1:8000/admin/'
Using the URLconf defined in orangeowl.urls, Django tried these URL patterns, in this order:
    ^product/$
    ^product/(?P<slug>[-\w]+)/$
The current URL, admin/, didn't match any of these.
Run Code Online (Sandbox Code Playgroud)

urls.py

from django.conf.urls import patterns, include, url
from django.conf.urls.defaults import *
from django.contrib import admin
from website.models import Product
from website.views import index

admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/', admin.site.urls), #Lets us access the admin page
    (r'^$', 'orangeowl.website.views.index'),
)


urlpatterns = patterns('django.views.generic.list_detail',
    url(r'^product/$', 'object_list',
        {'queryset': …
Run Code Online (Sandbox Code Playgroud)

python django

1
推荐指数
1
解决办法
559
查看次数

如何使用公共密钥将列表列入字典?

list = ['Roses are red','Sun is shining','cream comes from the bottom']

dict = {'john':'Roses are red', 'john':'Sun is shining','john':'cream comes from the bottom'}
Run Code Online (Sandbox Code Playgroud)

我希望我有道理.

python dictionary list

0
推荐指数
1
解决办法
77
查看次数

标签 统计

python ×2

css ×1

dictionary ×1

django ×1

html ×1

javascript ×1

list ×1

tabs ×1

user-interface ×1