MontefuckeR
Registered
Как да направя скриване и показване на неопределен брой дива, като ид-то на дива е нещо такова div$id, идея как да ги вкарам в jQuery, с обикновен JS, може като аргумент да ги задавам :?
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS Search</title>
<script type="text/javascript">
var searchTag = "search"
function searchGet() {
searchUrl = window.location.href.split("?")
if (searchUrl[1]==null) {
document.searchForm.searchInput.focus()
} else {
document.searchForm.searchInput.value = searchUrl[1]
searchJs(searchUrl[1])
}}
function searchJs(searchString) {
var i=0
while (document.getElementById(searchTag+i)) {
str = document.getElementById(searchTag+i)
str.style.display = "block"
if (str.innerHTML.match(searchString)==null) {
str.style.display = "none"
}
i++
}
document.getElementById('search').focus()
}
function searchLink() {
document.searchForm.searchLink.value = searchUrl[0]+"?"+document.searchForm.searchInput.value
}
</script>
</head>
<body onload="searchGet();searchLink()">
<form action="" method="post" name="searchForm">
<input type="text" name="searchInput" onkeyup="searchJs(this.value)" autocomplete="off" />
Link:
<input type="text" name="searchLink" onfocus="this.select()" readonly />
</form>
<div id="search0">text</div>
<div id="search1">haha</div>
<div id="search2">lol</div>
<div id="search3">4eti</div>
<div id="search4">gledai be</div>
<div id="search5">lele maiko 4e si lud...</div>
</body>
</html>
При натискането на "Отвори" да се отваря съответния див.<div id="div4">info</div><a href="#">Отвори</a>
<div id="div54">info</div><a href="#">Отвори</a>
<div id="div52">info</div><a href="#">Отвори</a>
<div id="div31">info</div><a href="#">Отвори</a>
<div id="div13">info</div><a href="#">Отвори</a>
а е това е МЕРСИ!!!Liberate каза:http://roshanbh.com.np/2008/03/expandable-collapsible-toggle-pane-jquery.html :?: