아래와 같이 처리하니
pc에서는 이미지 맵이 되더라구요.
하지만 모바일에서는
적용이 안되어서요.
이미지맵은 모바일에서 사용이 불가한지요?
좋은 방법이 있다면 조언 부탁드립니다.
Copy
html_purifier 함수에 추가해주세요. $config->set('Attr.AllowedFrameTargets', array('_blank')); 부분 아래에 추가해주시면 됩니다. $def = $config->getHTMLDefinition(true); // Add usemap attribute to img tag $def->addAttribute('img', 'usemap', 'CDATA'); // Add map tag $map = $def->addElement( 'map', // name 'Block', // content set 'Flow', // allowed children 'Common', // attribute collection array(// attributes 'name' => 'CDATA', 'id' => 'ID', 'title' => 'CDATA', ) ); $map->excludes = array('map' => true); // Add area tag $area = $def->addElement( 'area', // name 'Block', // content set 'Empty', // don't allow children 'Common', // attribute collection array(// attributes 'name' => 'CDATA', 'id' => 'ID', 'alt' => 'Text', 'coords' => 'CDATA', 'accesskey' => 'Character', 'nohref' => new HTMLPurifier_AttrDef_Enum(array('nohref')), 'href' => 'URI', 'shape' => new HTMLPurifier_AttrDef_Enum(array('rect', 'circle', 'poly', 'default')), 'tabindex' => 'Number', 'target' => new HTMLPurifier_AttrDef_Enum(array('_blank', '_self', '_target', '_top')) ) ); $area->excludes = array('area' => true);
|
답변 1개 / 댓글 4개
채택된 답변
+20 포인트
얼마 전에 팁게에 올라온 거네요.
답변에 대한 댓글 4개
답변을 작성하려면 로그인이 필요합니다.
감사합니다.