我已经有一段时间没有使用PHP编码,不记得如何做到这一点..内HTML中使用引号属性
我使用的需要设置一些相对参数的jQuery插件。
$imgtag = '<a href="'.carturl($img->id,'images').'/'.$img->filename.'" class = "zoom" id="zoom1" rel="adjustX: 10, adjustY:-4, zoomWidth:150, zoomHeight:150">
<img src="'.$src.'"'.$titleattr.' alt="'.$alt.'" width="'.$width_a.'" height="'.$height_a.'" '.$classes.' /></a>';
现在我需要添加, position: "inside"
到相对位,然而,每次我这样做的时候,它在HTML输出作为引号所有的地方。该插件必须将“内部”这个单词的引号零散地工作,但是,我需要在“rel =”引号内使用这些引号。
我该如何解决这个问题?
HTML输出应该是这样的:
<a style="position: relative; display: block;" href="http://www.URL.com/theimage.jpg" class="cloud-zoom" id="zoom1" rel="adjustX: 10, adjustY:-4, zoomWidth:150, zoomHeight:150, position:"inside"">
<img style="display: block;" src="http://www.URL.com/theimage.jpg" alt="product-picture" height="450" width="360"></a>
谢谢!
你确定应该有位置引号:“里面”?不能只是位置:里面? – itsmeee
@itsmeee:它必须与引号:(不会工作没有 – MartinH23
它实际上是一个HTML问题,而不是PHP :) PHP只是生成任何HTML,你说他生成,所以我修正了标题更具描述性。 –