How i can adjust the all elements that web page has? - css

I have a web page, and when I am zooming, all the elements that are there in the page move.
How do I modify my CSS file in order to fix this issue?

When you zoom the page using: CTRL+ OR CTRL- your browser is changing the layout of your page.
The is no way in JS to capture this zoom event , the only thing you can do it to catch the resize event and "fix" your page layout there.

Related

Navigation Menu on Wordpress Page Items

I have a word press navigation bar which has 2 buttons Home and Contact. When hovering on the contact page there is a sub item called number. How do I stop the user navigating to the parent link? and only allow them to selected number and navigate to that page.
The quickest way would be to create that parent menu item with a URL of #/ which will prevent the click. It will append #/ to the url in the browser, but other than that nothing else will happen. Note that the slash at the end will prevent the page from scrolling to the top when clicked which is especially useful if you have a sticky menu.
If you want to prevent the URL from changing in your browser you can add some Javascript to prevent the click event for links with a href of #/ like this bit of jQuery...
$('a[href*=\\#\\/]').click(function (e) {
e.preventDefault();
});
As Jaxon said in the comments, you could then use CSS to change the cursor on those parent items (to default perhaps).
If you felt this method was too "hacky" you could use a Walker to actually override the output HTML, but depending on your implementation that feels like overkill to me for such a small effect. Plus, once you strip the a tag out you could run into other issues with your menu if your dropdowns require that tag to work properly.
You can try these steps in the wordpress console.
https://connectnc.com/clients/knowledgebase/112/How-to-make-menu-item-unclickable.html

Accessing multiple scroll bars using selenium

How to perform actions on the scroll bar present in an iFrame?
Issue 1:
I need to click on the link present in an iFrame which is displayed on scrolling the vertical bar. But when I try to click the link Selenium 2.0 is unable to find the element and it is scrolling the web page scroll bar.
Thanks in advance.
I think the best way to solve it is making your link visible through javascript (Changing the hidden property to visible).
Anyway, did you try sending a spacebar press using sendKeys? It will scroll down if you are already on the iframe
I used this to click the element - without seeing it (also in iframe). When I tried scrolling, or element.click(), the iframe scrollbar broke and test was unable to continue.
If you cannot find it like this, try using js to find it aswell.
WebElement element = getWebDriver().findElement(By.id("element_id"))
JavascriptExecutor jse = (JavascriptExecutor) getWebDriver();
jse.executeScript("arguments[0].click();", element);

Pinterest: How to make the content within iframe fancybox window pinable?

On my website, I have a list of users. By clicking each one, a fancybox pop up window will show. Within the window, I use iframe to load a page with paintings from the user.
Is there any way to make the images in fancybox iframe pinable by clicking pinterest bookmark pin it button? Or do I have to add a pin it button to each HTML page?
Thanks,
Milo
The bookmarklet button works on the page that is currently loaded. Usually, if an iframe has changed even slightly from its original url, it is inaccessible to the parent page via javascript. The actual iframe itself has to initiate the appropriate messaging request systems.
If you can have the iframe send a message to the parent window that contains the desired images and then have the parent window add the image links to the page, that seems to be the only way to do it right now. Look into the postMessage() function.
As you asked if there is "any way" to do it, I would say yes. However, it is very ugly. Probably better to add pinit buttons to each image in the iframe. :)

Immediately clearing the contents of an IFrame in Flex

I have a Flex HTML component that is displaying content from a remote URL and a button in the Flex application that reloads the content. However, it takes a few seconds for the IFrame's content to refresh. During this time, there is no obvious feedback to the user that any action is underway.
I would like to clear the contents of the IFrame, so there is immediate feedback after clicking refresh, and then load the remote URL again. Is there a way to do this?
I've tried setting the HTMLText property to "" and setting the IFrame location to "about:blank", and neither of these have the desired immediate effect. (on it's own, setting the location to about:blank immediately clears the IFrame, but if it is followed by resetting the location to the original URL, the immediate clearing doesn't occur. Is this something to do with the IFrame caching the original page?)
One approach is to remove the component from the display list and add a new instantiated component back in its place.
This will assure fully initialized state.
One other way you could get around would be having a blank iframe or loading screen ready with the same size and same position, while the contents are being loaded, hide the content iframe, and show the blank iframe or loading screen. This could be much easier to achieve a more flexible result.

Colorbox inside iFrame - Close from parent

I am working on a project where I am simply loading same directory content into an iFrame. No external pages.
I have Colorbox within the iFrame content which is working beautifully.
My question is: I have some "parent" buttons which I would like to make them close any of the iFrame Colorbox popups. The project is an "information point" system with some buttons in the parent that show at all times, but whenever I click the buttons the iFrame Colorbox stays open.
A lot of the pages I have found talk from the opposite way, controlling the parent from within a Colorbox iFrame...
I'm going to guess that this may not be achievable from a security point of view...
many thanks everyone :)
You might be able to do something like this:
$('.cboxIframe')[0].contentWindow().$.colorbox.close();
I ended up using jQuery the other way round so the child controls the parent and hides the parent controls and when the ColorBox control is closed it "shows" the parent controls.

Resources