eM^ Posted October 23, 2006 Report Share Posted October 23, 2006 veelos panakt lai ar mouse over uzliekas viena bilde bet mouse out cita. ka to panakt, maku tikai ar krasam, bet ka ir ar bildeem? Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2006 Report Share Posted October 23, 2006 http://www.google.lv/search?hl=lv&q=ja...+changing+image Īsumā: <img id="image" /> ... ...onmouseover="document.getElementById('image').src='bla.gif';"... ...onmouseout="document.getElementById('image').src='bla2.gif';"... Link to comment Share on other sites More sharing options...
GedroX Posted October 23, 2006 Report Share Posted October 23, 2006 (edited) Tieši tā pat kā ar krāsām. Gadījumā, kad imāge ir fonā: onmouseover="this.style.backgroundImage='url(/path/to/image.jpeg)'" onmouseout="this.style.backgroundImage='url(/path/to/another/image.jpeg)'" Labāk, protams, to darīt ar klasēm. P.S. Laikam labāk izmantot vienkāršus attēlus, savādāk IE ir problēmas ar background caching, kad tas mainās dinamiski (background image flickering). Edited October 23, 2006 by GedroX Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2006 Report Share Posted October 23, 2006 GedroX, tam risinājums ir izmantot javascript image preloading vai arī izmantojot sprite animation metodi (http://solardreamstudios.com/learn/css/spritenav). Link to comment Share on other sites More sharing options...
GedroX Posted October 23, 2006 Report Share Posted October 23, 2006 (edited) andri, javascript image preloading neder gadījumā, ja backs tiek uzdots caur CSS klasi (mans mīļākais variants - abi attēli - out and over - vienā attēlā). http://solardreamstudios.com/learn/css/spritenav nav risinājums image flickering problēmai iekš IE6, kad Temporary Internet Files => Settings... ieslēgts uz Every visit to the page. Edited October 23, 2006 by GedroX Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2006 Report Share Posted October 23, 2006 Skaidrs, es ar image flickering problem sapratu kautko citu. Link to comment Share on other sites More sharing options...
GedroX Posted October 23, 2006 Report Share Posted October 23, 2006 Par IE background image flicker problēmu: Internet Explorer IE6 will try to reload every image file for every image element that you add to a webpage via JavaScript. For example changing html object class with background image dynamically. The only solution found by now is adding and configurating module mod_expires for Apache. Good description, tests and links on ahinea.com. Link to comment Share on other sites More sharing options...
eM^ Posted October 23, 2006 Author Report Share Posted October 23, 2006 paldies Link to comment Share on other sites More sharing options...
eM^ Posted October 26, 2006 Author Report Share Posted October 26, 2006 Gribeeju veel pajautat kaa uzlikt skanju uz mouseover? visadi meginaju, bet nesanak. Link to comment Share on other sites More sharing options...
andrisp Posted October 26, 2006 Report Share Posted October 26, 2006 (edited) hmm.. http://www.javascripter.net/faq/sound/index.htm http://www.javascripter.net/faq/sound/onhover.htm Bet imo tam vairāk paredzēts flash. Edited October 26, 2006 by andrisp Link to comment Share on other sites More sharing options...
Recommended Posts