Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][CSS][HTML] Nakładanie obrazków
Micchaleq
post
Post #1





Grupa: Zarejestrowani
Postów: 186
Pomógł: 4
Dołączył: 13.10.2009

Ostrzeżenie: (0%)
-----


Witam serdecznie,

Przy pomocy JS chciałbym zrobić sobie menu, które pokazuje w jakim dziale znajduje się użytkownik, czyli podswietlenie aktualnego buttona.

Robie to za pomocą :

  1. $(function(){
  2. $('body').wskaznik();
  3. });
  4.  
  5. (function($) {
  6. $.fn.wskaznik = function() {
  7. var url = location.href;
  8. var re = /([a-z]+)\.html$/;
  9. if (url.match(re)) {
  10. var wynik = url.match(re);
  11. this.first().attr('id', wynik[1]);
  12. } else {
  13. this.first().attr('id', 'index');
  14. }
  15. };
  16. })(jQuery);


kod CSS

  1. #menu{
  2. width: 985px;
  3. height: 82px;
  4. }
  5. #index #menu{
  6. background: url('./img/home_.png') no-repeat;
  7. z-index: 5;
  8. }
  9.  
  10. a.home{
  11. background: url('./img/home.png');
  12. width: 197px;
  13. height: 84px;
  14. display: block;
  15. overflow:hidden;
  16. float: left;
  17. z-index: 1;
  18. }
  19. a.home:hover{
  20. background-position: 0px -84px;
  21. z-index: 1;
  22. }
  23.  
  24. <div id="menu">
  25. <a href="index.html" class="home"></a>
  26. </div>


niestety pomimo użycia z-index obrazek home_.png pokazuje się pod home.png
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 20:51