Thursday 15 July 2010

css - iphone 3 / 4 background-image url constant path fails -


मेरे पास पृष्ठभूमि छवि बदलने के लिए सरल jQuery कोड है।

  $ ("# headerimg" + ActiveContainer)। Css ({"background-image": "url (" + photoObject.image + ")", "प्रदर्शन": "ब्लॉक", "z-index": currentZindex});   

जब मैं पृष्ठभूमि छवि को सापेक्ष पथ के रूप में सम्मिलित करता हूं तो यह काम करता है

  डिस्प्ले: ब्लॉक; पृष्ठभूमि-छवि: यूआरएल ("./ wp-content / images / 2013/02 / turkish_gulets_for_sale_master-1350.jpg"); Z- इंडेक्स: -375;   

लेकिन जब मैं एचटीटीपी के साथ सम्मिलित करता हूँ तो यह विफल रहता है। (यह कोड सभी ब्राउज़रों को काम करता है जो मैं देखता हूं।)

  डिस्प्ले: ब्लॉक; पृष्ठभूमि-छवि: url ("http://guletsforsale.org/wp-content/images/2013/02/turkish_gulets_for_sale_master-1350.jpg"); Z- इंडेक्स: -375;   

समाधान क्या हो सकता है।

सादर

क्या आपको पूरे http पथ का उपयोग करने की आवश्यकता है? आप अपने मूल () को निकाल सकते हैं और उस लिंक को रिश्तेदार बना सकते हैं:

  var orig = window.location.origin; RelativePath = httpPath.replace (मूल, "");   

तो, अब आपके पास सापेक्ष पथ है, जैसा आपको काम करना चाहिए।

No comments:

Post a Comment