Yep, that’s what I thought.
Will need help on this one…
I could manually create a div with an embed HTML element and associate “coordinates” with custom CSS.
But doing so, I can’t add content inside this div from the designer:
Got it. Looks like you need to use some jQuery for this. Let me try to give you some idea how it may look like.
You need to make sure the slug is derived from the title for code below to work.
// Grab the list item
var listitem = $('.list-item') // You need to change this to the class you are using.
var slug = '';
listitem.hover( function() {
slug = convertToSlug(listitem.text());
$('.dot-' + slug).css('transform', 'scale(2)'); // This should scale the dot.
},
function() {
slug = convertToSlug(listitem.text()); // This will get the slug version of the title
$('.dot-' + slug).css('transform', 'scale(1)'); // This should reverse the scale.
}
);
function convertToSlug(Text)
{
return Text
.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'')
;
}
Hey @Victor_M, this should get you 90% there. I’m sure theres a way to shorten the code and better animation. I have marked where you can edit the animation/function.
var listitem = $('.list-item') // You need to change this to the class you are using.
var slug = '';
listitem.hover( function() {
slug = convertToSlug($(this).children('.heading').text());
$('.dot-' + slug).css('transform', 'scale(2)'); // Custom function here
},
function() {
slug = convertToSlug($(this).children('.heading').text()); // This will get the slug version of the title
$('.dot-' + slug).css('transform', 'scale(1)'); // Custom function here
);
function convertToSlug(Text)
{
return Text
.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'')
;
}
var listitem = $('.list-item') // You need to change this to the class you are using.
var slug = '';
listitem.hover( function() {
slug = convertToSlug($(this).children('.heading').text());
$('.dot-' + slug).css('transform', 'scale(2)'); // Custom function here
},
function() {
slug = convertToSlug($(this).children('.heading').text()); // This will get the slug version of the title
$('.dot-' + slug).css('transform', 'scale(1)'); // Custom function here
}
);
function convertToSlug(Text)
{
return Text
.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'')
;
}