How can we integrate bxslider in to Angularjs app? - angularjs

Iam using bxslider in Angularjs app.But when I use ng-repeat it is not working.Below is the angular code.
Thanks in Advance.
<ul class="bxslider" ng-repeat="image in vm.listFullProductDetails[0].ProductImage">
<li>
<img src="/{{image.ProductimageFilepath}}" />
</li>
</ul>
When I remove ng-repeat and add some images , it works fine.How can i resolve the problem.Below is the code.
<ul class="bxslider">
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
<li>
<!--<img ng-src="/{{image.ProductimageFilepath}}" />-->
<img src="/Images/user4.jpg" />
</li>
</ul>

The problem is you are repeating the ul tag and thereby repeating class="bxslider". This causes every image to be wrapped within a ul and treat them as separate slider.
<ul class="bxslider">
<li ng-repeat="slide in slides">
<img ng-src="{{slide.src}}" alt="" />
</li>
</ul>
Check this solution by Richard Chu -> http://codepen.io/funkybudda/pen/pnmou

Related

(Reactjs) Convert HTML template with lots of dashes in class and Property/attribute names

I'm using a HTML template to build a reactjs/nextjs web site.
The header that has the navigation is complex menu design with drop downs.
I can't get it to render correctly in my nextjs app, and I'm pretty sure its becuase a lot of the classNames and attibutes have '-' in their names.
This is what the HTML looks like:
<header class="page-head">
<!-- RD Navbar-->
<div class="rd-navbar-wrap rd-navbar-minimal">
<nav class="rd-navbar" data-layout="rd-navbar-fixed" data-sm-layout="rd-navbar-fixed" data-md-device-layout="rd-navbar-fixed" data-lg-layout="rd-navbar-static" data-lg-device-layout="rd-navbar-static" data-stick-up-clone="false" data-md-stick-up-offset="100px" data-lg-stick-up-offset="100px">
<div class="container container-fluid">
<div class="rd-navbar-inner">
<!-- RD Navbar Panel-->
<div class="rd-navbar-panel">
<!-- RD Navbar Toggle-->
<button class="rd-navbar-toggle" data-rd-navbar-toggle=".rd-navbar-nav-wrap"><span></span></button>
<!-- RD Navbar Brand--><a class="rd-navbar-brand brand" href="index.html">
<div class="brand-logo">
<svg x="0px" y="0px" width="157px" height="41px" viewbox="0 0 157 41">
<text transform="matrix(1 0 0 1 1.144409e-004 32)" fill="#2C2D2F" font-family="'Grand Hotel'" font-size="45.22">QuickFood</text>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#EB5453" d="M43.743,2.954c2.606,0,4.719,2.091,4.719,4.672 c0,2.58-2.113,4.672-4.719,4.672c-2.606,0-4.719-2.091-4.719-4.672C39.024,5.045,41.137,2.954,43.743,2.954z"></path>
</svg>
</div></a>
</div>
<!-- RD Navbar Nav-->
<div class="rd-navbar-nav-wrap">
<!-- RD Navbar Nav-->
<!-- RD Navbar Nav-->
<ul class="rd-navbar-nav">
<li><a class="navbar-icon restaurant-icon-19" href="#">Menu</a>
<!-- RD Navbar Dropdown-->
<ul class="rd-navbar-dropdown menu-img-wrap">
<li class="menu-img"><img src="images/menu-food-01.png" alt="" width="88" height="60"><span>Pizzas</span></li>
<li class="menu-img"><img src="images/menu-food-02.png" alt="" width="88" height="60"><span>Burgers</span></li>
<li class="menu-img"><img src="images/menu-food-03.png" alt="" width="88" height="60"><span>Drinks</span></li>
<li class="menu-img"><img src="images/menu-food-04.png" alt="" width="88" height="60"><span>Tosts</span></li>
<li class="menu-img"><img src="images/menu-food-05.png" alt="" width="88" height="60"><span>Salads</span></li>
<li class="menu-img"><img src="images/menu-food-06.png" alt="" width="88" height="60"><span>desserts</span></li>
</ul>
</li>
<li><a class="navbar-icon thin-icon-tag" href="#">News</a>
<ul class="rd-navbar-dropdown">
<li>Classic Blog</li>
<li>Grid Blog</li>
<li>Masonry Blog</li>
<li>Modern Blog</li>
<li>Blog Post</li>
</ul>
</li>
<li><a class="navbar-icon thin-icon-map-marker" href="contacts.html">Contacts</a></li>
</ul>
<!-- RD Navbar Shop-->
<ul class="rd-navbar-shop list-inline">
<li><a class="unit unit-horizontal unit-middle unit-spacing-xxs link-default" href="tel:#">
<div class="unit-left"><span class="icon icon-md icon-primary thin-icon-phone-call text-middle"></span></div>
<div class="unit-body">
<address class="contact-info"><span class="text-bold big">+1 (409) 987–5874</span></address>
</div></a></li>
<li><a class="unit unit-horizontal unit-middle unit-spacing-xxs link-gray-light" href="shop-cart.html">
<div class="unit-left"><span class="icon icon-md icon-primary thin-icon-cart"></span></div>
<div class="unit-body"><span class="label-inline big">2</span></div></a></li>
</ul>
</div>
</div>
</div>
</nav>
</div>
</header>
How do I go about dealing with all the attributes and class names that have a - in the names?
There is a js file that relies on the names being accurate to make the template work.

How to make image clickable

<div className="col-lg-3 col-md-3">
<li>
<img src='https://i.imgur.com/fe0T4nw.png' onClick="https://arizonaatwork.com" />
</li>
</div>
In my project I am importing an image and on the onclick I want the image to take them to a URL. How can I get this done?
You can use a tag:
<li><a href='https://arizonaatwork.com'><img src='https://i.imgur.com/fe0T4nw.png'/></a></li>
Working example:
You need to add "a" tag before image
<div className="col-lg-3 col-md-3">
<li>
<img src='https://i.imgur.com/fe0T4nw.png' onClick="https://arizonaatwork.com" />
</li>

AngularJS - ng-repeat data flashes then dissapears

I have the following:
<li ng-repeat="deposit in currentDeposits">
<img src="#{{ deposit.displayUrl }}" />
<a class="name" href="http://steamcommunity.com/profiles/#{{ deposit.steam_id }}">#{{ deposit.displayName }}</a>
<p class="name">Deposited #{{ deposit.items.length }} skins worth $#{{ deposit.value }}!</p>
<hr />
<li ng-repeat-end>
<div class="new-round">
<p>^ NEW ROUND START ^</p>
</div>
<hr />
</li>
</li>
<li ng-repeat="deposit in lastGameDeposits">
<img src="#{{ deposit.displayUrl }}" />
<a class="name" href="http://steamcommunity.com/profiles/#{{ deposit.steam_id }}">#{{ deposit.displayName }}</a>
<p class="name">Deposited #{{ deposit.items.length }} skins worth $#{{ deposit.value }}!</p>
<hr />
<li ng-repeat-end>
<div class="new-round">
<p>^ NEW ROUND START ^</p>
</div>
<hr />
</li>
</li>
This first ng-repeat data shows fine, however the data inside the second ng-repeat only flashes on screen, then disappears. Occasionally the data will stay however this isn't common.
Is this a know issue?

angular-carousel: overflow-x: scroll inside a slide

i'm trying to create a carousel that inside of it will be scrollable div with images.
The problem is that the swipe events conflict with eachother.
Plunker (the images are on slide 2)
My code:
<div class="carousel-demo">
<ul rn-carousel rn-carousel-index="carouselIndex" rn-carousel-buffered class="carousel1">
<li ng-swipe-left="left($event)">slide #1</li>
<li ng-swipe-right="right($event)">slide #2
<div class="horizontal-slide">
<div class="span2">
<a href="#" class="thumbnail">
<img src="http://placehold.it/150x100" alt="" />
</a>
</div>
<div class="span2">
<a href="#" class="thumbnail">
<img src="http://placehold.it/150x100" alt="" />
</a>
</div>
<div class="span2">
<a href="#" class="thumbnail">
<img src="http://placehold.it/150x100" alt="" />
</a>
</div>
<div class="span2">
<a href="#" class="thumbnail">
<img src="http://placehold.it/150x100" alt="" />
</a>
</div>
</div>
</li>
<li>slide #3</li>
</ul>
Thank's alot
Avi

Highslide Image Gallery DotNetNuke

I am trying to use Highslide (http://highslide.com/) on my DotNetNuke site.
The problem is the thumbnails simply link to the images, rather than opening in Highslide.
It is as if the javascript is being ignored.
I have the thumbnail images appearing in the screen shots section - example here:
http://leansoftware.net/en-us/help/exceldatabasetasks/introduction.aspx
I have included the javascript references in the heading of the module:
<script type="text/javascript" src="http://leansoftware.net/highslide/easing_equations.js"></script>
<script type="text/javascript" src="http://leansoftware.net/highslide/highslide-with-gallery.js"></script>
<script type="text/javascript" src="http://leansoftware.net/highslide/highslide.config.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://leansoftware.net/highslide/highslide.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="http://leansoftware.net/highslide/highslide-ie6.css" />
<![endif]-->
And then in the DNN module content :
<div class="highslide-gallery">
<ul>
<li>
<a href="http://leansoftware.net/highslide/images/large/Edit_Titles.jpg" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Edit_Titles.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/DataSourceTab.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DataSourceTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/Help/ExcelDatabaseTasks/Introduction/tabid/151/ctl/Edit/mid/682/language/en-US/highslide/images/large/Excel-More-Options.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-More-Options.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Workstation-Tab.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Workstation-Tab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/DestTemplateTab.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DestTemplateTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Auto-Filter.jpg" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Auto-Filter.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Edit-Relational-Data-In-Excel.jpg" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Edit-Relational-Data-In-Excel.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/Help/highslide/images/large/DataLoad.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DataLoad.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Batch-Tab.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Batch-Tab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/WorksheetTab.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/WorksheetTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/Help/ExcelDatabaseTasks/highslide/images/large/Task-Parameters-In-Action.jpg" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Task-Parameters-In-Action.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Task-Parameters.JPG" class="highslide">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Task-Parameters.JPG" />
</a>
</li>
</ul>
<div style="clear: both;"></div>
</div>
Please can anyone suggest a fix?
EDIT (by Author) : 08:19 GMT
Thank you for the responses.
The code now reads:
DNN Module header:
script type="text/javascript" src="http://leansoftware.net/highslide/easing_equations.js"></script>
<script type="text/javascript" src="http://leansoftware.net/highslide/highslide-with-gallery.js"></script>
<script type="text/javascript" src="http://leansoftware.net/highslide/highslide.config.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://leansoftware.net/highslide/highslide.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="http://leansoftware.net/highslide/highslide-ie6.css" />
<![endif]-->
HTML Module:
<div class="highslide-gallery">
<ul>
<li>
<a href="http://leansoftware.net/highslide/images/large/Edit_Titles.jpg" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Edit_Titles.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/DataSourceTab.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DataSourceTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-More-Options.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-More-Options.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Workstation-Tab.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Workstation-Tab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/DestTemplateTab.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DestTemplateTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Auto-Filter.jpg" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Auto-Filter.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Edit-Relational-Data-In-Excel.jpg" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Edit-Relational-Data-In-Excel.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/Help/highslide/images/large/DataLoad.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/DataLoad.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Batch-Tab.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Batch-Tab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/WorksheetTab.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/WorksheetTab.JPG" />
</a>
</li>
<li>
<a href="http://leansoftware.net/Help/ExcelDatabaseTasks/highslide/images/large/Task-Parameters-In-Action.jpg" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Task-Parameters-In-Action.jpg" />
</a>
</li>
<li>
<a href="http://leansoftware.net/highslide/images/large/Excel-Task-Parameters.JPG" class="highslide" onclick="return hs.expand(this, config1)">
<img alt="" src="http://leansoftware.net/highslide/images/thumbs/Excel-Task-Parameters.JPG" />
</a>
</li>
</ul>
<div style="clear: both;"></div>
</div>
Your "a href's" simply aren't invoking the Highslide JS script. It's not enough simply to label them with "class='highslide'". You need to add an onclick attribute.
Let's take your first link:
<a href="/highslide/images/large/Edit_Titles.jpg" class="highslide">
This needs to be:
<a href="/highslide/images/large/Edit_Titles.jpg" class="highslide" onclick="return hs.expand(this)">
The link to your highslide.config.js file is also a problem. It's pointing to something that appears not to exist.

Resources