Magnific Popup: source title from span

前端 未结 2 1979
猫巷女王i
猫巷女王i 2021-02-09 04:47

I want to take the title for my Magnific images from a hidden caption field inside the anchor tag - NOT from the title. This is because my title contains markup.

HTML

相关标签:
2条回答
  • 2021-02-09 05:10
    return item.el.find('span').text();
    
    0 讨论(0)
  • 2021-02-09 05:13

    Thank you. This has proved useful for me. I couldn't get it to work quite like the example though - the problem is with putting an href in the span element. This results in nested a tags, which are illegal in HTML. This W3C document below relates to HTML 4, but I believe the same applies to HTML 5.

    http://www.w3.org/TR/html401/struct/links.html#h-12.2.2

    0 讨论(0)
提交回复
热议问题