I have problem with displaying images in my slideshow. I basically cut index page to pieces and put them in var's and I want to use react-routing to make it work. And it does (sort of)
I have section with Slides - everything is fine except that images are not displaying. (Just images - text works just fine)
var Slides = React.createClass({
render : function() {
return (
<div class="container">
<div class="row wrap">
<div class="col-md-12 gallery">
<div class="camera_wrap camera_white_skin" id="camera_wrap_1">
<div data-thumb="" data-src="images/slides/blank.gif">
<img src="images/slides/blank.gif"/>
<div class="img-responsive camera_caption fadeFromBottom">
<h2>Great cars</h2>
</div>
</div>
<div data-thumb="" data-src="images/slides/blank.gif">
<div class="img-responsive camera_caption fadeFromBottom">
<h2>Fast cars</h2>
</div>
</div>
<div data-thumb="" data-src="images/slides/blank.gif">
<div class="img-responsive camera_caption fadeFromBottom">
<h2>Super cars</h2>
</div>
</div>
<div data-thumb="" data-src="images/slides/blank.gif">
<div class="img-responsive camera_caption fadeFromBottom">
<h2>We have it all!</h2>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
});
var App = React.createClass({
render : function() {
return (
<div id="home">
<div class="headerLine">
<div id="menuF" class="default">
<div class="container">
<div class="row">
<Logo />
<Header />
</div>
</div>
</div>
<Slides />
</div>
<div class="container">
<div class="row">
<div class="col-md-12 cBusiness">
{this.props.children}
</div>
</div>
</div>
</div>
)
}
});
I am guessing because I am new to react (and to javascript) I might not know of some way of transforming this DIV to JS code.
Related
I am trying to render the react code on the server side. The code is being built and then rendered on the browser. But the classes that need to be added in the react code is being omitted. Can anyone please help me with what exactly is happening here.
This is how the code should appear but the classes are changed when the code is rendered
<div class="events-s">
<div class="content-w">
<div class="content">
<h1 class="event-section">Events</h1>
<div class="feature-events">
<h2 class="pb-block">Featured Events</h2>
</div>
</div>
</div>
<div class="content-w">
<div class="content">
<div class="pb-b">
<div class="pb-b"></div>
<h2 class="pb-block-t">Where We'll Be Next</h2>
</div>
</div>
</div>
<div class="content-w">
<div class="content">
<div class="pb-b">
<h2 class="pb-block-t">Past Events</h2>
</div>
</div>
</div>
</div>
how the code is actually rendered :
**<div class="main-content">**
<div class="content-w">
<div class="content">
<h1 class="event-section">Events</h1>
<div class="feature-events">
<h2 class="pb-block">Featured Events</h2>
</div>
</div>
</div>
<div class="content-w">
<div class="content">
<div class="pb-b">
<div class="pb-b"></div>
<h2 class="pb-block-t">Where We'll Be Next</h2>
</div>
</div>
</div>
<div class="content-w">
<div class="content">
<div class="pb-b">
<h2 class="pb-block-t">Past Events</h2>
</div>
</div>
</div>
</div>
This was solved .. i was not using the correct relative url to fetch the page
so the contents were not loaded correctly
I have a 3 column div with multiple rows. What is the most dynamic way to extract content from the first div and append/prepend this to the 3rd div - Ensuring that all following divs follow along.
here is my example code:
<div class="content">
<div class="item">
<div class="col1">
<div class="img1">
<img src="img_in_first_col">
</div>
</div>
<div class="col2"></div>
<div class="col3">
<div class="img2">
<img src="img_in_third_col">
</div>
</div>
</div>
<div class="item">
<div class="col1">
<div class="img1">
<img src="img_in_first_col">
</div>
</div>
<div class="col2"></div>
<div class="col3">
<div class="img2">
<img src="img_in_third_col">
</div>
</div>
</div>
<div class="item">
<div class="col1">
<div class="img1">
<img src="img_in_first_col">
</div>
</div>
<div class="col2"></div>
<div class="col3">
<div class="img2">
<img src="img_in_third_col">
</div>
</div>
</div>
</div>
I've tried using something along the lines of:
$('.item .col1 .img1').each(function(){
$(this).prependTo('.item .col3 .img2')
})
but what i get is all the images being added to all the rows.
Please help! thanks in advance
Should be as simple as this:
$(".col1").each(function (index, element) {
$(this).closest(".col3").prepend($(this).contents());
});
You could use this to insert column 1 after column 3:
$('.col1').each(function(){
$(this).insertAfter($(this).siblings('.col3'));
});
... or before column 3:
$('.col1').each(function(){
$(this).insertBefore($(this).siblings('.col3'));
});
Used jQuery functions:
insertAfter
insertBefore
siblings
I'm trying to display the details of an email side by side (this is only a section of the full page) but the details from the row containing the from/to and date/cc/bcc information overlap a lot before stacking when the page resizes and I'd like them to stack before this problem arises. The following is the simplified version of what I have:
<div>
<div class="row">
<div class="col-xs-10">
<span style="font-weight:bold;" data-bind="text:Subject"></span>
</div>
<div class="col-xs-2">
<button class="btn btn-default" style="float:right; height:30px;">
<img src="..." style="max-height:20px; border:none;" />
</button>
</div>
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<div class="row">
<div class="col-xs-12">From: </div>
<div class="col-xs-12"> </div>
<div class="col-xs-12">To: </div>
</div>
</div>
<div class="col-xs-10">
<div class="row">
<div class="col-xs-12">FromName</div>
<div class="col-xs-12">email</div>
<div class="col-xs-12">ToName</div>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<div class="row">
<div class="col-xs-12">Date: </div>
<div class="col-xs-12">Cc: </div>
<div class="col-xs-12">Bcc: </div>
</div>
</div>
<div class="col-xs-10">
<div class="row">
<div class="col-xs-12">date</div>
<div class="col-xs-12">Cc address</div>
<div class="col-xs-12">Bcc address</div>
</div>
</div>
</div>
</div>
</div>
<div>
Bootply Example
Columns overlap because the col-xs-2 is too small for the content in it:
<div class="col-xs-2">
<div class="row">
<div class="col-xs-12">From: </div>
<div class="col-xs-12"> </div>
<div class="col-xs-12">To: </div>
</div>
</div>
Inspect with Dev tools the <div class="col-xs-2"> which contains From: to see that when the text overlaps the content area is smaller than the text length.
To solve it you can change the col-xs-NUMBER for a bigger NUMBER (try with 4) also changing the detailed column (to 8, if you replace the previous with 4).
I created a grid with col-md-7 on the left and col-md-5 on the right.
And I put images to the col-md-5, which are responsive and in col-md-12 width - full width
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-7">LEFT SIDE</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt="" />
</div>
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt="" />
</div>
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt="" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Demo : http://jsfiddle.net/r8rFc/298/
It works great without any problems.
However, I use a menu called Zozo UI tabs.
When I put my code into Zozo UI container div, the images overlap rather than staying on top of each other.
Thus, it just show the last IMG
I would add the whole code to here but unfortunately it has a lot of dependencies.
Please check from here.
xxx
<!-- Overview -->
<div class="z-content z-active" style="position: relative; display: block; left: 0px; top: 0px;">
<div class="z-content-inner">
<div class="row">
<div class="col-md-7">
<div class="row">
<div class="col-md-12">
LEFT
</div>
</div>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt=""/>
</div>
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt=""/>
</div>
<div class="col-md-12">
<img class="img-responsive" src="http://patdollard.com/wp-content/uploads/2014/07/ap_holder_121003_wg.jpg" alt=""/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Need a way to get that images on the top of each other rather than overlapping.
You have
.productgroup img {
position: absolute;
}
it seems to be the reason of your problem.
I'm trying to apply transitions as explained in here, but some cards fail to do a second transition/animation. Is it CSS, Semantic UI or me? You can try adding more cards to the test.
Edit:
As #niba requested, I made a jsfiddle to show what is
happening. Look that I named cards from "Card 0" to "Card 7". Run
several times and you may see some are missing.
Here is the code:
$(document)
.ready(function() {
$('.card')
.transition('fade')
.transition('fade', function() {
console.log('finished');
});
<div class="ui cards">
<div class="green card">
<div class="image">
<img src="img/1.jpg">
</div>
<div class="content">
<a class="header">Header</a>
<div class="meta">
<div class="ui small star rating"></div>
</div>
<div class="description">Description</div>
</div>
</div>
<div class="green card">
<div class="image">
<img src="img/2.jpg">
</div>
<div class="content">
<a class="header">Header</a>
<div class="meta">
<div class="ui small star rating"></div>
</div>
<div class="description">Description</div>
</div>
</div>
<div class="green card">
<div class="image">
<img src="img/3.jpg">
</div>
<div class="content">
<a class="header">Header</a>
<div class="meta">
<div class="ui small star rating"></div>
</div>
<div class="description">Description</div>
</div>
</div>
</div>