Bootstrap - Carousel Jumbotron - Iframes with WebGL content - php

This question is pretty specific, but I'll ask anyways.
First off, I know iframe's are probably not the best design but I don't know how else to solve my problem. Anyways, let me start of with some background information:
I have a page with some WebGL content on it (it just loads a .obj and .mtl model using Three.js, and adds some keyboard navigation for camera movement).
This page is structured so that it gets a variable using php's $_GET array, and then loads the model based on that variable (if the variable was "Bus" then it would load from obj/Bus/Bus.obj, and if the variable was "Shoe" then it would load from obj/Shoe/Shoe.obj).
The link to the page would be like "browser.php?name=Bus" or "browser.php?name=Shoe".
Now, I want to display several of these pages in a carousel of iframes. Because I am using Bootstrap, this task is trivial with the following code:
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<iframe src="browser.php?name=Bus" height="500" width="500">
<div class="container">
<div class="carousel-caption">
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
<br />
<br />
</div>
</div>
</div>
<div class="item">
<iframe src="browser.php?name=Shoe" height="500" width="500">
<div class="container">
<div class="carousel-caption">
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
<br />
<br />
</div>
</div>
</div>
</div>
</div><!-- /.carousel -->
This works perfectly except for one issue, the carousel-caption and all of its content are not showing. I am not sure if this is because of the iframe, or of the WebGL content, because when I just had an image there, its content was showing.
WebGL Iframe Carousel:
Normal Image Carousel:
Finally, my question: How do I fix my code / organization / design so that I can display the WebGL content in a carousel?
Sorry if this is a duplicate, but I was unable to find any relating links on google.
Thanks for taking your time to read/possibly answer this question,
Bucco
[EDIT]:
I just realized that my question was horribly worded, and was not clear enough. My main issue is with the navigator arrows not showing up in the WebGL content carousel (see the images). How do I fix my design / code so that I can display the WebGL content in a carousel with the navigator arrows?

The only obvious thing I see is that the <iframe>s are missing their closing tags, which are actually required according to the W3C (http://www.w3.org/TR/html-markup/iframe.html#iframe-tags).
I assume the normal behavior of an <iframe> is kicking in, which means that any children of the <iframe> are only displayed if the src cannot be loaded. Or, stated another way: lacking the closing tag, it looks like your navigation elements are treated as "fallback" content rather than sibling elements.
In fact, loading your content into a jsFiddle seems to prove me out: http://jsfiddle.net/dRtvH/ - w/o closing tags, no carousel, but simply closing the <iframe>s makes the nav buttons show up.

Related

WordPress is adding absolute path to my image multiple times

I have a quite specific problem to solve today - I just can't get my head wrapped around it. Makes totally no sense for me...
It's about a live site: http://rawrockchick.com/#testimonial-slider
If you scroll down to the testimonials on the home page (the link above should bring you there) you'll see that the slider arrows are missing. For a reason I can't figure out the URL is prepended a couple of times before the image src:
<img src="http://rawrockchick.comhttp://rawrockchick.comhttp://rawrockchick.com/media/manual/slider-arrow-left.png">
This wasn't the case two weeks ago, without anybody consciously touching it. I first thought of some Javascript thing happening with the bootstrap slider, but as you can see the testimonial image itself is not affected, even though it's placed in the exact way as the sliders are.
The whole slider is a very simple bootstrap carousel. Excerpts (relevant section) of the code:
<div class="item active">
<div class="row">
<div class="col-sm-8">
<p>"An up-and-coming UK raw food teacher and songstress, Barbara Fernandez has it going on! This girl can do food prep! Her Raw Mexican food is amazing"</p>
<p class="testimonial-author">Nomi Shannon</p>
<p class="testimonial-role">rawgourmet.com</p>
<a class="left carousel-control" href="#testimonial-slider" data-slide="prev"><img src="/media/manual/slider-arrow-left.png"></a>
<a class="right carousel-control" href="#testimonial-slider" data-slide="next"><img src="/media/manual/slider-arrow-right.png"></a>
</div>
<div class="col-sm-4">
<img src="/media/test-nomi-150.jpg" class="img-responsive hidden-xs hidden-sm img-circle" style="margin-left:25px;">
</div>
</div>
</div>
As you can see the images are inserted the exact same way.
What I tried already (no change):
I moved the <img src="/media/manual/slider-arrow-left.png"> out of the link and placed it directly under the working image, the same strange behavior occurs for the slider arrow (by this test I wanted to make sure there's no jquery rule affecting only that one column of the slider, or the a tag).
Hardcoding absolute image URL (src="http://rawrockchick.com/media/manual/slider-arrow-left.png")
WordPress PHP query for image URL (src="<?php echo home_url(); ?>/media/manual/slider-arrow-left.png")
I'd be very thankful if anyone had any ideas about that phenomena. Or idea how to debug it further.
I am not really sure why you are getting a double URL but using an absolute path to your image could help solve things.
<img src="<?php echo home_url(); ?>/media/test-nomi-150.jpg" class="img-responsive hidden-xs hidden-sm img-circle" style="margin-left:25px;">
Solved.
Found it out via disabling plugin for plugin that a Pinterest hover button plugin (this to be precise) was causing that mysterious phenomena.
Thanks for all the answers and hints!

"Inactive Wrapper" creating TONS of blank space

I'm in the process of creating a website (a beginner obviously) and for some reason, on one of my pages, the footer section is MUCH longer than it is supposed to be. Its werid because on other pages, it looks fine. I used the exact same code on a new page and the footer is all out of whack. Here's what I get when I inspect the element on Chrome:
<div id="skel-layers-inactiveWrapper" style="height: 100%;">
I can't find anything regarding inactive Wrappers or anything of the sorts in any of my css files either. Thanks for the help.
Make sure you have you a doctype defined
<!DOCTYPE HTML>
Solved the issue for me.
*I know I'm a bit late on this
try to hide the element <div id="skel-layers-inactiveWrapper">
The CSS
#skel-layers-inactiveWrapper{
display:none!important;
}
Try changing the "100%" to a smaller value, or post more code so we have more to work with :)
Height of 100% refers to the height of the container. The chances are that the instances that work have a surrounding DIV which this one does not and so it is probably taking the height of the entire body (or much larger div) and doubling it.
Here is the entire code in context. The only tags it is embedded within are and tags.
<footer id="footer">
<!-- Contact -->
<h2 class="major"><span> Get in touch</span></h2>
<center><ul class="contact">
<li><a class="icon fa-facebook" href="#"><span class="label">Facebook</span></a></li>
<li><a class="icon fa-twitter" href="#"><span class="label">Twitter</span></a></li>
<li><a class="icon fa-google-plus" href="#"><span class="label">Google+</span></a></li>
</ul></center>
<!-- Copyright -->
<div id="copyright">
<ul class="menu">
<li>© Govpal. All rights reserved 2014</li>
</ul>
</div>
</footer>

ckeditor auto content change

I am using ckeditor to insert some html structure into db. I firstly use code view to paste html structure into editor, after inserting into mysql db, until echo at webpage, the html structure data are still maintained.
However, when the same data is called into the same ckeditor again for updating, the structure is destroyed, and I found the ckeditor has automatically changed html tags to the codes, below is an extract:-
A) html code to be pasted to editor code view for inserting (good)
<a href="#">
<img src="../catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
B) db data (good)
<a href="#">
<img src="../catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
C) webpage data called from db (good)
called by html_entity_decode($record["content"],ENT_COMPAT, 'UTF-8');
<a href="#">
<img src="/catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
D) code view in ckeditor, with contents filled from the above data (changed)
called by html_entity_decode($record["content"],ENT_COMPAT, 'UTF-8');
<img alt="" src="../catalog/view/theme/default/images/services/b1.jpg" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"> </div>
</div>
<div class="cat-title-bg">SERVICES</div>
How can I ask ckeditor not to add changes to the data?
CKEditor modifies your HTML because it is incorrect. You cannot put block elements inside of <a> unless you use HTML5 which isn't supported by CKEditor yet.
See my answer for related question. Also take a look at this one regarding blocks in <a>.

How to set cursor off screen?

I'm creating a website for a kiosk. I've got 3 divs on one page, everytime when a div is clicked, next div shows up using a photoslide, and the previous div hides away.
My problem is that when the welcome screen (first div) is showing (the whole page/div is an a tag), the status bar down the bottom shows the linking address all the time. I posted another post, people told me it is not possible to hide the status bar.
So my question is how do I set the cursor to be off screen/off set, so the status bar only shows when a visitor is interacting with the screen.
Can I set the cursor offset using javascript, html/css or php? Any code/suggestions is appreciated.
Thanks!
Here is my html page below or see http://jsfiddle.net/EXfnN/8/
<div id="item1" class="item">
<div class="content">
<a href="#item2" class="panel">
<video id="my_Video" width="100%" height="100%" preload="auto" autoplay loop>xxxxxx
</video>
</a>
</div>
</div>
<div id="item2" class="item">
<div class="content">
<div id="back">
<ul id="awesome-menu">
<li>
ABC
</li>
<li>
National
</li>
<li>
Other
</li>
</ul>
</div>
</div>
</div>
<div id="item3" class="item">
<div class="content">
<img src="images/thankyou.jpg" alt="Thank you" /></div>
</div>
I'd suggest that if you're using JavaScript for this, that you don't need ANCHOR tags because you've already negated the need for them.
I'd suggest changing to adding click events to the div tags and storing additional application data on "data-" attributes and reading those with JavaScript instead.
This workaround eliminates a few problems like the one above.
you could make the first element a div only (without the a tag) catch the onclick event and then redirect via javascript (or do whatever action the a tag has)?

PHP Hover action [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
Building the site out at http://nelsonkeating.com/
When hovering over an image you will see 3 actions appear. How can I remove these, and instead just display the title of the page when the user hovers (the title is currently right below the image)
*This is a wordpress site.
Thanks!
The outputted HTML looks like this (after a lot of output cleanup):
<div class="img-container">
<img width="310" height="206" src="http://nelsonkeating.com/wp-content/uploads/2012/01/whit-and-me-park-310x206.png" class="attachment-post-thumbnail wp-post-image" alt="whit and me park" title="whit and me park" />
<div class="actions">
Enlarge
<a class="share">Share</a>
<span>0</span> Comment
<div class="share-container">
<div class="share-icons">
Twitter
Facebook
StumbleUpon
Technorati
Digg
Delicious
Email
</div>
</div><!-- #share-container -->
</div><!-- #actions -->
<div class="clearfix"></div>
</div><!-- #img-container -->
<h2>What We Do</h2>
So, there are a few things to note here. The actions div looks like it is the one that is being displayed on hover. The <h2> is what you want to show. So, the hacky thing to do is to just put the <h2> generation inside the actions div and comment out (or remove) that code.
A better solution is to, in addition to that, dig through the jQuery and make sure you aren't breaking any of that code on hover. Also, since I can only guess this is a theme, there might be a few issues that crop up because of this. Themes are usually pretty tightly constructed (in my experience at least) and changing something can have a cascading effect.
IF you see your html for each of these containers it's in the form of:
<div class="img-container">
<img width="310" height="315" src="http://nelsonkeating.com/wp-content/uploads/2012/01/DW3-310x315.jpg" class="attachment-post-thumbnail wp-post-image" alt="D&W3" title="D&W3" />
<div class="actions">
Enlarge
<a class="share">Share</a>
<span>0</span> Comment
<div class="share-container">
<div class="share-icons">
<a href="javascript: void(0)" class="twitter-share iframe" onClick="twitPop('http://nelsonkeating.com/whitney-danielle/', 'Whitney & Danielle - ', 'sawyerh:Best Designer Alive')">
Twitter</a>
<a href="http://www.facebook.com/sharer.php?u=http://nelsonkeating.com/whitney-danielle/&t=Whitney & Danielle" class="facebook-share" target="_blank">
Facebook</a>
<a href="http://www.stumbleupon.com/submit?url=http://nelsonkeating.com/whitney-danielle/&title=Whitney & Danielle" class="stumble-share" target="_blank">
StumbleUpon</a>
<a href="http://technorati.com/cosmos/search.html?url=http://nelsonkeating.com/whitney-danielle/" class="tech-share" target="_blank">
Technorati</a>
<a href="http://digg.com/submit?phase=2&url=http://nelsonkeating.com/whitney-danielle/&title=Whitney & Danielle" class="digg-share" target="_blank">
Digg</a>
<a href="http://del.icio.us/post?url=http://nelsonkeating.com/whitney-danielle/&title=Whitney & Danielle" class="delicious-share" target="_blank">
Delicious</a>
<a href="mailto:EMAIL?body=http://nelsonkeating.com/whitney-danielle/" class="email-share" target="_blank">
Email</a>
</div>
</div><!-- #share-container -->
</div><!-- #actions -->
<div class="clearfix"></div>
</div><!-- #img-container -->
Without knowing how the script is exactly working i would suggest you modify the content inside the actions class which is revealed on hover

Categories