开发者

I'm getting 404 errors with Fancybox images

开发者 https://www.devze.com 2023-03-18 10:49 出处:网络
I\'m getting 404 errors in my log having to do with fancybox. /products/product1/fancybox/fancy_shadow_se.png

I'm getting 404 errors in my log having to do with fancybox.

/products/product1/fancybox/fancy_shadow_se.png
/products/product1/fancybox/fancy_shadow_ne.png
/products/product1/fancybox/fancy_shadow_n.png
/products/product1/fancybox/fancy_nav_right.png
/products/product1/fancybox/fancy_close.png

These pngs are all referenced in the fancybox css file. For instance:

.fancybox-ie #fancy-bg-n    { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-ne   { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-e    { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-se   { filter: progid:DXImageTransform.Microsoft.AlphaIm开发者_如何学编程ageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-s    { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-sw   { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-w    { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
.fancybox-ie #fancy-bg-nw   { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }

I have fancybox installed at this location:

/js/fancybox/

The box comes up all nice and pretty.

So what's wrong? I can't figure it out. The CSS looks right and I think I've installed it in the right spot. An incorrect solution would be to put absolute paths in the CSS file. Any other ideas?


Your url is looking for a directory from where it's executed. Either change your relative url (../imagename.png if it's just a sibling directory) or provide an absolute path to your images.

To clarify, if your script is executing from js/fancybox and you specify an image like /fancybox/image.png it will look for the image in js/fancybox/fancybox/image.png. If the image is directly in the fancybox folder your script is in, just specify the image name and don't prepend it with any relative path. If you specify your directory structure, I can give you a better relative url to use, otherwise the fully qualified path will work for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号