-
Search Results
-
Hi
I see there are a lot of threads around creating clickable hotspots rather than rollover ones. However, none do exactly what I need them to do or work in more recent versions of Enfold. So I wonder if anyone can help.
This is how I’d like it to work:
1 A Hotspot activates a tooltip onclick (rather than rollover) and stays activated (to enable users to click for more information on that tooltip)
2 The tooltip closes when the user clicks on the corresponding hotspot OR selects a new hotspot by clicking on it.I appreciate that Show on mouse hover – hide on click does something similar but it is confusing users in testing.
Please see https://owe.brother.design/discover/ for the map. Password below in private content
Can anyone help?
Hi Enfold-team,
I have a question about the ‘Image with hotspots’ element. There are three options for displaying tooltips: on mouseover, always, or ‘show on mouseover, hide on click.’ In the latter case, however, you must click directly on the respective hotspot to close the tooltip. Is it possible to make it so that you can click anywhere on the page to close the tooltip?
Thanks in advance!
Ita
Dear Support Team:
As part of my responsive images work, I am trying to replace a banner-like image on my home page, that spans the entire browser window width, with a smaller image on smaller windows/screens. I have an Image inside a Color Section at the top of the home page (under the header) that I inserted from my Media Library (that includes the alt & title text). Initially I tried with CSS (couldn’t get it to include alt & title text on the images), and now with Javascript (can’t get it to work at all).
I’ve tried specifically in (i) Firefox in Windows 7, (ii) Safari, Firefox, & Chrome on a Mac desktop, and (iii) Safari on an iPhone: the smaller banner does not load (and the larger banner displays only because it’s in the Color Section).
So, as I wrote, initially I tried with CSS:
@media only screen and (min-width:965px) { .homeBannerIMG { content: url(https://...banner1.jpg); } .homeBannerIMG::before { /* For Firefox issues */ content: url(https://...banner1.jpg); } } @media only screen and (max-width:964px) { .homeBannerIMG { content: url(https://...banner2.jpg); /* Concatenating '/ "test alt"' to the end doesn't work */ } .homeBannerIMG::before{ content: url(https://...banner2.jpg); } /* Note: https://developer.mozilla.org/en-US/docs/Web/CSS/content says this works: content: url("http://www.example.com/test.png") / "This is the alt text"; BUT IT DOESN'T FOR ME!. Plus I want the image Title as well for the hover tooltip. */But I wasn’t able to maintain my alt & title text on the image. So I switched to Javascript (in my child functions.php file), first trying:
function displayHomeBanner() { if (window.matchMedia("(min-width: 965px)").matches) { document.getElementById("homeBannerIMG").src="https://...banner1.jpg"; } else { document.getElementById("homeBannerIMG").src="https://...banner2.jpg"; } }But that didn’t work: when I made my browser window below 965px wide, banner2 was not swapped in; it stayed as banner1. Then I tried:
document.getElementById("homeBannerIMG").getElementsByTagName('img')[0].src="https://...banner2.jpg";But that didn’t work. Then I tried:
document.getElementsByClassName("homeBannerIMG")[0].src="https://...banner2.jpg";Still no luck. I just can’t get banner2 to display.
Note that my full CURRENT code in my child function.php file is:
function windowSizeActions() { ?> <script> window.onresize = actOnWindowSize; window.onload = actOnWindowSize; function actOnWindowSize() { function displayWindowSize() { myWidth = window.innerWidth; myHeight = window.innerHeight; document.getElementById("dimensions").innerHTML = " >>> " + myWidth + " x " + myHeight; } function displayHomeBanner() { if (window.matchMedia("(min-width: 965px)").matches) { /*document.getElementById("homeBannerIMG").src="https://...banner1.jpg";*/ document.getElementsByClassName("homeBannerIMG")[0].src="https://...banner1.jpg"; } else { /*document.getElementById("homeBannerIMG").src="https://...banner2.jpg";*/ /*document.getElementById("homeBannerIMG").getElementsByTagName('img')[0].src="https://...banner2.jpg";*/ /* Based on https://kriesi.at/support/topic/using-javascript-to-set-image-src-using-developer-id/: document.getElementById(‘work_image’).getElementsByTagName(‘img’)[0].src = work_image; */ document.getElementsByClassName("homeBannerIMG")[0].src="https://...banner2.jpg"; } } displayWindowSize(); displayHomeBanner(); } </script> <?php } add_action( 'wp_enqueue_scripts', 'windowSizeActions' );First of all, as you can see, I’ve commented out my earlier attempts at loading the src, with just my last attempt with getElementsByClassName live.
Secondly, I have my displayHomeBanner function embedded in the function actOnWindowSize, and that in an overall function windowSizeActions, because I need debug code to display the window size, done by my displayWindowSize function (and another function elsewhere to set up the HTML). That function works: my window size is displayed at the top of my window constantly, and changes as I change the browser window size. So this also ensures that things are working, except displayHomeBanner is not working.
Also note that I have tried my code outside of WordPress/Enfold/Aria, using any w3schools.com‘s page’s Try it Yourself button:
<!DOCTYPE html> <html> <body> <div> <img id="homeBannerIMG" src="https://...banner1.jpg" alt="test alt" title="test title"> </div> <script> window.onresize = actOnWindowSize; window.onload = actOnWindowSize; function actOnWindowSize() { function displayWindowSize() { /* This of course won't work here, but it's irrevelent. */ myWidth = window.innerWidth; myHeight = window.innerHeight; document.getElementById("dimensions").innerHTML = " >>> " + myWidth + " x " + myHeight; } function displayHomeBanner() { if (window.matchMedia("(min-width: 965px)").matches) { document.getElementById("homeBannerIMG").src="https://...banner1.jpg"; } else { document.getElementById("homeBannerIMG").src="https://...banner2.jpg"; } } displayHomeBanner(); } </script> </body> </html>and
<!DOCTYPE html> <html> <body> <div> <img class="homeBannerIMG" src="https://...banner1.jpg" alt="test alt" title="test title"> </div> <script> window.onresize = actOnWindowSize; window.onload = actOnWindowSize; function actOnWindowSize() { function displayWindowSize() { /* This of course won't work here, but it's irrevelent. */ myWidth = window.innerWidth; myHeight = window.innerHeight; document.getElementById("dimensions").innerHTML = " >>> " + myWidth + " x " + myHeight; } function displayHomeBanner() { if (window.matchMedia("(min-width: 965px)").matches) { document.getElementsByClassName("homeBannerIMG")[0].src="https://...banner1.jpg"; } else { document.getElementsByClassName("homeBannerIMG")[0].src="https://...banner2.jpg"; } } displayHomeBanner(); } </script> </body> </html>In both, my displayHomeBanner function works: my banner2 displays on smaller window sizes (and the title tooltip works)!
Can you help me get it to work in WordPress please.
Thank you,
GaryHi,
is it possible to display as soon as the page loads, the search field in the menu? By default, you must click on the magnifying glass logo to display it.
It is also not present in the code until you click on this logo.
His class is avia-search-tooltip if that can help.
Best regards,
GuillaumeHi, I have this code to underline my links.
/*** links subrayados ***/
.avia_textblock p a, .avia_textblock li a, .avia-tooltip p a {
text-decoration:underline !important;
}Could you please give me the code to add the text in the accordion container?
Thanks in advance!
Arantza


