Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

Filma-King

Member
  • Content Count

    1
  • Joined

  • Last visited

  1. In my experience updating my Squarespace website for my filmmaking business, I ran into an issue displaying titles and descriptions on my video thumbnails in the gallery grid; something to do with a bug on squarespace' behalf. I wrote some code to get around this, which I will share below. I also created some code to reveal the titles/descriptions whilst curser hovers over: var x = document.getElementsByClassName("sqs-video-wrapper"); var i; for(i = 0; i < x.length; i++) { var labelstr = x.getAttribute("data-html"); var labels = labelstr.match(new RegExp('title="' + "(.*)" + '" ')); var newdiv = document.createElement('div'); var classatt = document.createAttribute('class'); classatt.value = "image-slide-title"; newdiv.setAttributeNode(classatt); if (typeof labels[1] !== 'undefined') { newdiv.appendChild(document.createTextNode(labels[1])); x.parentNode.parentNode.appendChild(newdiv); console.debug(labels[1]); } } Hover display code: .image-slide-title { display: none; } .margin-wrapper:hover .image-slide-title { display: block; }
×
×
  • Create New...