I've just created a tshirt shop to put on my own website. A company called spreadshirt.co.uk (hereafter "SS") runs the shop. They allow me to embed their shop on my site via an iframe, and since they allow the CSS to be fully customisable through their admin panel I've got it looking pretty neatly integrated with my site.
The only catch is the iframe - I've set it to 2000 pixels high at the moment (just right for the longest pages). I'd rather have it resize for each page, but expect that to be "hard" so didn't bother.
Anyway, I've just put the page live, and put a test order through it. All is good, until....
...the "Verified by VISA" page. This motherhubbard turns up right at the end of the order process, and the HTML contained in it puts the little dialogue centred vertically in my iframe. I.e. nearly 1000 pixels down from the top - making less savy users think the page hasn't loaded (all they can see without scrolling down is a white background). I can't customise the CSS on this page like I can the SS pages, as this page isn't served up by SS.
Any clever ideas???
Many thanks people!
I'll put a link to my site if people want to see it, but assumed that might be seen as spammy and frowned upon.
I don't deal with iframes too much as i hate them, but i think you can still write to that document using javascript. Reason i say maybe is because its cross domain, but it should still work.
Check this post out
Resizing an iframe based on content
You could also check out
Resizing iframe to fit its content
and a jquery script:
http://www.lost-in-code.com/programming/jquery-auto-iframe-height/
Again, I really don't know if this will work on a cross-domain website.
Related
I would like to confirm what effect this CSS code has on the homepage of a wordpress website.
.lazy { display: none !important; }
Many thanks for explanations.
I have noticed images in the homepage are being blocked from being displayed which is why im asking this question.
The CSS code itself, prevent any element which has it from being displayed on the screen.
Due to its name, it may be used to enable something called lazyload (you can read about it here).
lazyload is usually used for several reasons:
Remove the pressure of loading many images at first; sometimes images are placed at the end of the page so the client won't see it at the top of the page, with lazy loading trick it. You can prevent those images from being loaded, and force them to load only the moment your client reach them by scrolling or other events so it cause page loading improvements (because the page is now lighter)
For making some visual effects; almost everywhere you need the image to be hidden and after some juggling or some specific events it is shown (like wp-admin and sub-menus, which will be shown if you hold your mouse on or click them)
etc
Recording to the reasons; I guess your kind of codes (which will be handled in client-side and client browser) does not fit the first reason and may be used for the second one because for the first reason it is better (and I guess it must) implemented on server-side. Why? Because in your code, the image is loaded and be will there and just not shown because of the CSS code
This was all I know but if you want a more specific answer you have to say where you saw it in WordPress, in a plugin, wp-admin, template, etc...
Hope the answer becomes handy for you
Since google updated their way of scoring mobile I have trouble to optimise my websites.
I want to know what am I doing wrong and what should be done to existing sites to make the score higher. Its easy to get 95-100 on desktop but on same site on mobile will be 25...
Before someone says to follow suggestions by insights then I will say that I do and I managed to remove most of them - worst thing is that the score didn't move at all. This is the biggest struggle I have, it seems that whatever I do it wont be good enough...
I followed this guide https://kinsta.com/blog/google-pagespeed-insights/ + some of my own solutions.
Is there anyone that has any good tips or permanent solution for this issue?
Google Report
As evident from your Page Speed Insights report, the main factor responsible for your low score is images. The solution to this is using RESPONSIVE IMAGES, which will drastically improve the speed of your website on mobile. What it basically means is that, you'll have to keep different sizes of the same image available for the browser and browser will decide which version of the image is suited on a particular resolution.
1) Here's everything you need to know about Responsive Images --> Responsive Image (CSS Tricks)
2) You have to shift the <link href=".." .../> and <script> tags from top of the page to the bottom of the page, just after the <body> tag. This will fix the `Eliminate render blocking resources issue.
3) You can use Javascript Minifier to minify your JS. Just paste your existing JS code inside the Input Javascript box on the website and click MINIFY
Also, cache policy is also one of the factors, bringing your score down. An efficient Cache policy will make browsers, load your website faster, after the first load. Cache handling is server specific, its different for Apache, Express etc.
I am supporting a website:
https://www.allcounted.com/
If you first look at the home page or What's Hot page and then click the Subject or Country page in the top navigation, you would see the page move left a little.
I know this is a CSS issue, but I am unable to find out the CSS rules that creates this issue. This website uses bootstrap-3.2.0 and some other tools.
At my screen this page seems displaying correctly (Chrome 57). This 'movement' what are you talking about's occurring because of browser is scrollbar, I guess, if I m wrong, punish me, but also I may recommend you using Developer Tools at your browser to inspect that. :)
If you could share more info I will be glad. (Some screens etc.)
I´m having a big big problem with adsense, no matter what I do the adsense result iframe is loading inside other iframe. I´m using WordPress + Bootstrap Framework.
This particular site has two different ads, first use an adserver service which give me his own script, this script is placed in the header.php inside of a <div id="top-space"> and the adserver handle with the script to show an <iframe> and inside that iframe the objet flash of the banner.
The adsense code is in the sidebar and to place it I use a text wodget, put the code there and that´s it.
In 60% of the times the site loads in the correct position each banners, the adserver banners are in the top and adsense ads in the sidebar.
BUT! randomly the adsense iframe is loading inside of the adserver iframe. I tried to use this solution but don´t work at all.
I´m desesperate because my client is loosing money, the site don´t show the right ads, and some times adsense iframe push adserver ads so the site looks crappy.
Even I try to use adrotate wordpress plugin thinking that help me avoid this bug, but nothing.
This sounds like it could be a caching problem. I've noticed in the past, iframes usually don't refresh unless you specifically right-click and refresh each individual one. If you're running any WordPress caching, clear that, then your browser cache, or try an incognito window.
i have domain.com it has a 300x250 box with in the overall site i want to create a widget with and allow other people to put it on their site.
the 300x250 box is mixed in with a lot of other stuff and i can not put that 300x250 box on its own page since it is dependent on other stuff.
i have found similar threads on stackoverflow that say the following work
<div style="overflow:hidden; width:608px; height:270px;">
<iframe scrolling="no" frameBorder="0"
src="http://tech-revolution.com/forum/vbshout.php?do=detach&instanceid=1#dbtech_shoutbox1"
style="width:728px; height:270px; border:none; margin-left:-60px;"/>
</div>
or
$('#target-div').load('http://www.mywebsite.com/portfolio.php #portfolio-sports');
i did the first one and it works fine the second one i didnt get around to yet.
my question is which one of these methods is "better" or is there a different way to show a PORTION of a site on other websites?
Option 1 - IFRAME
Pros
Will work
If your iFrame content has links/postbacks these will continue to work (within the iFrame).
Cons
The main windows OnLoad event is postponed until the iframe has completed loading, which can give the user the sense that the page is taking longer to load, they are also alledgely more expensive to create.
Option 2 - JQuery/DIV
Pros
Can be scripted to load after the parent page has loaded to give a
more responsive feel.
Once retrieved, the content will be in your domain so there's scope
for the client to manipulate style/content of the DIV content.
Cons
Won't work as its cross-domain, there are ways around this though:
Any postbacks and links maynot work if relative paths have been used,
likewise stylesheets and images in that content.
Summary
IFrame for simplicity, DIV would require more work but potentially could be more flexible and arguably faster.