| Autor | Zpráva | ||
|---|---|---|---|
| H.V. Profil * |
#1 · Zasláno: 7. 1. 2014, 23:55:29
prosím moc o radu. mám zde tento rychlý vyhledávač:
<script type="text/javascript" >
$(function() {
var self = this;
self.input = $("#search").select().focus();
//handles searching the document
self.performSearch = function() {
//create a search string
var phrase = self.input.val().replace(/^\s+|\s+$/g, "");
phrase = phrase.replace(/\s+/g, "|");
//make sure there are a couple letters
if (phrase.length < 3) { return; }
//append the rest of the expression
phrase = ["\\b(", phrase, ")"].join("");
//search for any matches
var count = 0;
$("h1, h3, p").each(function(i, v) {
//replace any matches
var block = $(v);
block.html(
block.text().replace(
new RegExp(phrase, "gi"),
function(match) {
count++;
return ["<span class='highlight'>", match, "</span>"].join("");
}));
});
//update the count
$(".result-count").text(count + " nálezu!");
//clear this search attempt
//should be gone anyways...
self.search = null;
};
self.search;
self.input.keyup(function(e) {
if (self.search) { clearTimeout(self.search); }
//start a timer to perform the search. On browsers like
//Chrome, Javascript works fine -- other less performant
//browsers like IE6 have a hard time doing this
self.search = setTimeout(self.performSearch, 100);
});
});
</script>
<div class="searchbar" >
<div class="searchbar-inner" >
<img style="float:left;" alt="Bible" height="50" src="/img/Bible_.jpg"/> <h3>Nástroj Bible </h3>
<br />
Vyhledat výraz, nebo větu: <input type="text" id="search" />
</div>
</div>výsledek zde: http://www.kristusjezis.cz/zjeveni-janovo/ ale když do vyhledávače zadám slovo, vyhledá to krásně, ale rozhodí se mi stránky, když se to zadá... v css to není, zkoušel jsem dát css pryč a chyba přetrvává .highlight {
background : #853037;
color: #fff;
font-weight: bold;
padding: 5px;
border: 1px solid #000;
}
.searchbar {
position: fixed;
background: #853037;
color: #fff;
width: 50%;
bottom: 20px;
text-shadow:none;
font-weight: bold;
border: 1px solid #898989;
font-size: 15px;
}
.searchbar-inner {
padding: 10px;
}
.searchbar-inner h3{
padding: 10px;
margin: 0px!important;
color: #fff!important;
}
.searchbar-inner img{
padding-right: 10px;
float:left;
}
.searchbar-inner input {
width: 300px;
padding: 5px;
font-weight: bold;
}
poradíte prosím? |
||
|
Časová prodleva: 3 dny
|
|||
| peta Profil |
#2 · Zasláno: 10. 1. 2014, 12:58:23
<span class='highlight'>", match, "</span>" padding: 5px; border: 1px solid #000; Dale doporucuji pouzit na stranku validator, je tam chyb, jak maku a kdo vi, co to provede v kombinaci s css. |
||
| H.V. Profil * |
#3 · Zasláno: 10. 1. 2014, 14:26:40
no vždycky se tu objeví odpověď když už to mám vyřešené :-) ale díky za snahu
|
||
|
Časová prodleva: 13 let
|
|||
0