简体   繁体   English

带有PHP / CodeIgniter的Bootstrap 3工具提示

[英]Bootstrap 3 tooltip with PHP / CodeIgniter

I'm adding html to my page via PHP and can't seem to get my bootstrap tooltip image to work to function properly. 我正在通过PHP将html添加到我的页面中,但似乎无法使我的引导工具提示图像正常工作。

<li class="list-group-item col-lg-3 col-md-3 col-sm-3 col-xs-3"><a href="'.site_url(url_title($artist['firstname'].' '.$artist['lastname']).'-a'.$artist['id']).'" data-toggle="tooltip" data-placement="auto" data-html="true" title="<img src="'.base_url('image/get/resize/'.IMAGE_RESIZE_AND_CROP.'/width/200/height/150/id/'.$artwork[0]['image_id']).'">">'.$artist['firstname'].' '.strtoupper($artist['lastname']).'</a></li>

The problem is located in my tooltip title: 问题位于我的工具提示标题中:

title="<img src="'.base_url('image/get/resize/'.IMAGE_RESIZE_AND_CROP.'/width/200/height/150/id/'.$artwork[0]['image_id']).'">"

Result: Screenshot 结果: 屏幕截图

The names appear this way: ">Raymond ABNER and there is nothing in the tooltips. From what I conclude, the problem is possibly in my usage of " and ', but I can't find a workaround (also, not sure about this). 名称显示如下:“> Raymond ABNER,工具提示中没有任何内容。根据我的结论,问题可能出在我使用“和”时,但我找不到解决方法(也不确定该)。

Just found the answer... The " within my src= where the problem. Took them off and it works fine. 刚刚找到了答案...问题出现在我的src =中。

Final code segment: 最终代码段:

<li class="list-group-item col-lg-3 col-md-3 col-sm-3 col-xs-3"><a href="'.site_url(url_title($artist['firstname'].' '.$artist['lastname']).'-a'.$artist['id']).'" data-toggle="tooltip" data-placement="auto" data-html="true" title="<img src='.base_url('image/get/resize/'.IMAGE_RESIZE_AND_CROP.'/width/200/height/150/id/'.$artwork[0]['image_id']).'>">'.$artist['firstname'].' '.strtoupper($artist['lastname']).'</a></li>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM