My website does not show images when viewed in Firefox, but works perfectly in Chrome [closed]

妖精的绣舞 提交于 2019-12-13 23:30:49

问题


I'm aware that this is nothing new and will happen, but I've just run out of ideas of what to correct. I tried validating my website code, fixed encoding, but to no avail.

Here it is: www.arturstols.com (you click the logo)

It uses jQuery to slide images inside the central container, which doesn't show. The intro graphic does though.


回答1:


Instead of images\pic.png put images/pic.png .




回答2:


You are using the incorrect slash for the image urls...

<div id="gallery">
    <img alt="" src="images\title_903x600.jpg" style="margin: 5px 0px;">
    <img alt="" src="images\rukitis.jpg">
    <img alt="" src="images\danny.jpg">
    <img alt="" src="images\ernests.jpg">
    <img alt="" src="images\toms.jpg">
    <img alt="" src="images\forest.jpg">
    <img alt="" src="images\fight.jpg">                                 
    <img alt="" src="images\light.jpg">
    <img alt="" src="images\mirror.jpg">
    <img alt="" src="images\scene.jpg">
</div>

should be...

<div id="gallery">
    <img alt="" src="images/title_903x600.jpg" style="margin: 5px 0px;">
    <img alt="" src="images/rukitis.jpg">
    <img alt="" src="images/danny.jpg">
    <img alt="" src="images/ernests.jpg">
    <img alt="" src="images/toms.jpg">
    <img alt="" src="images/forest.jpg">
    <img alt="" src="images/fight.jpg">                                 
    <img alt="" src="images/light.jpg">
    <img alt="" src="images/mirror.jpg">
    <img alt="" src="images/scene.jpg">
</div>



回答3:


You should specify image src paths using a forward slash. For eg.

<img alt="" src="images/title_903x600.jpg"> 

instead of

<img alt="" src="images\title_903x600.jpg">

as you have currently specified.

This solves the issue for firefox. Chrome is extra smart :)




回答4:


On a side note, i like your photography but it seemed to load slowly, perhaps look into a jquery pre load function.

$.fn.preload = function() {
this.each(function(){
    $('<img/>')[0].src = this;
});

}

// Usage:

$(['img1.jpg','img2.jpg','img3.jpg']).preload();



来源:https://stackoverflow.com/questions/13995439/my-website-does-not-show-images-when-viewed-in-firefox-but-works-perfectly-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!