#StackBounty: #javascript #jquery #html #css #twitter-bootstrap-3 JQUERY.COUNTO.JS: On Scroll Count Numbers NOT OnLoad

Bounty: 50

I’m working with one page website and I want to add a counting numbers with it, so I use javascript.countTo.js. I created every section to group related data and I put the section counter <section id="counters"> below my portfolio section <section class="justaddheight portfolio">. Everytime the page load the number count and when I scroll I always see that numbers stop or ended it’s counting. Now, I want the number counts when I scroll and get into the section counter <section id="counters">. In addition, I used WOW.js and easingJS with my site, it’s the best if you combined the code with it, but it also acceptable if not. The code are the following below:


<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1"><!--The Viewport-->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!--Character Set-->
        <meta http-equiv="Cache-control" content="no-cache"> <!--The No-Cache-->

        <link rel="stylesheet" href="css/animate.min.css">
        <!-- Bootstrap -->
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <!-- Font-Awesome -->
        <link rel="stylesheet" href="css/font-awesome.min.css">
        <!-- Icomoon-->
        <link rel="stylesheet" href="css/icomoon.css">
        <!-- Simple Line Icons -->
        <link rel="stylesheet" href="css/simple-line-icons.css">     
        <!-- Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>


        <!-- jQuery -->
        <!-- Bootstrap -->
        <!-- Wow -->
        <!-- Counter -->
        <!--Custom JS-->
    <body id="top">
        <section class="justaddheight text-center about" >
            <h1>SCROLL DOWN</h1>
            <p>First, Scroll Now</p>
            <p>Second, try Again but wait for few seconds before scroll to identify.</p>
         <section class="justaddheight service">

         <section class="justaddheight portfolio">

        <section id="counters">
89 Finished projects
2343409 Templates
1302 Cup of coffees
52 Happy clients
</div> </div> </div> </section> </body> </html> <style type="text/css"> /* USE JUST TO ADJUST HEIGHT*/ .justaddheight{ height: 500px; } .text-center{ text-align: center; } </style> $('.counter-number').countTo();

Get this bounty!!!

#StackBounty: #html #css #architecture #sass (S)CSS architecture: alternative backgrounds styling

Bounty: 100

I’m using ‘component’ approach to CSS as in SMACSS / ITCSS, I’m still scratching my head about styling sections with alternative (dark) background.

e.g. Stripe has regular (dark text on white) and alternative (white text on dark) sections.

enter image description here

As I understand there are options assuming HTML:

<section class="dark">
    <a href="#" class="btn">Action</a>

Style in context of section, e.g.:

.dark h2, .dark p, .dark btn {
  color: white;

But a) context styling is not recommended; b) where does one put the styles? (Harry Roberts argues that in component’s file)

Create alternative-colored components with modifiers

And change the HTML, e.g.:

.title--alt-color {color: white;}
.text--alt-color {color: white; }

But a) it doesn’t work when you don’t know which components will go in there; b) more work of managing HTML.

Maybe there is a better way to handle this?

Get this bounty!!!

#StackBounty: #javascript #css #angularjs #angularjs-directive #angularjs-scope Angular Digest Loop on ng-style

Bounty: 50

I have a filter that changes filtered object. But when I’m using ng-style="item.gridSize"
My Filter: (The Algorithm for size Grid was taken (changed for my needs) from Here

angular.module("custom.modules.photoGrid", []).filter('photoSearch', [function () {
    function getGrid(photos){
        var output = [];
        var HEIGHTS = [];
        var COLUMN_WIDTH = 227;
        var MARGIN = 6;
        var DELTA = 20;

        var size = window.innerWidth - 50;
        var n_columns = Math.floor(size / (2 * (COLUMN_WIDTH + MARGIN)));
        var small_images = [];

        function create_columns(n) {
            HEIGHTS = [];
            for (var i = 0; i < n; ++i) {

        function get_min_column() {
            var min_height = Infinity;
            var min_i = -1;
            for (var i = 0; i < HEIGHTS.length; ++i) {
                if (HEIGHTS[i] < min_height) {
                min_height = HEIGHTS[i];
                min_i = i;
            return min_i;

        function gridSize(i, is_big) {
            var size = {
                'margin-left': (MARGIN + (COLUMN_WIDTH + MARGIN) * i)+'px',
                'margin-top': (HEIGHTS[Math.floor(i / 2)] * (COLUMN_WIDTH + MARGIN))+'px',
                'width': is_big ? (COLUMN_WIDTH * 2 + MARGIN)+'px' : COLUMN_WIDTH+'px',
                'height': is_big ? (COLUMN_WIDTH * 2 + MARGIN)+'px' : COLUMN_WIDTH+'px'
            return size;
        function createGrid(data){
            if (data.length >= 2) {
                for(var i = 0; i < data.length; i++){
                    var column = get_min_column();
                    if (Math.random() > 0.8) {
                        data[i]['gridSize'] = gridSize(column * 2, true);
                        HEIGHTS[column] += 2;
                    } else {
                        if (small_images.length === 2) {
                            data[small_images[0]]['gridSize'] = gridSize(column * 2, false);
                            data[small_images[1]]['gridSize'] = gridSize(column * 2 + 1, false);
                            HEIGHTS[column] += 1;
                            small_images = [];
                if (small_images.length) {
                    column = get_min_column();
                    data[(data.length-1)]['gridSize'] = gridSize(column * 2, false);

            return data;
        var grid = createGrid(photos);
        return grid;

    return function(photos, search) {
        var filtered = [];
        if(!!search){ /**@case1 if only search query is present**/
            search = search.toLowerCase();
            for(var i = 0; i < photos.length; i++){
                if(photos[i].photo_name.toLowerCase().indexOf(search) !== -1){

        }else {
            /**@case2 no query is present**/
            filtered = photos;
        filtered = getGrid(filtered);
        return filtered;


<input type="text" ng-model="input.value"> <span>{{ results.length }}</span> Photo Found

A small explanation:
Every time ng-model input.value changed filter is runed and creates different grid for filtered array of photos. all dimensions are written inside gridSize and this cause digest loop.

What I’ve tried until now: I’ve moved my ng-repeat in directive, but this way I can’t access result.length and input.value.

I’ve also tried a bindonce directive but using it like bo-style="photo.gridSize" doesn’t change the grid after user search(and is logically right because is bidden only once, but values changed.

So my question is how to make ng-repeat assign new grdiSize property without running in digest loop.


Get this bounty!!!

#StackBounty: #html #css #angular2 Angular 2 get elements width, and offset

Bounty: 50

I have a template that creates a list of links using *ngFor and a separate div element that I want to change its location based on the currently active link.


This results in a structure like so:

I want my highlighter div to get the width of Link 1 when activeLink = 0. Similar to this plain js:

var High = document.getElementById('highlighter');
High.style.width = document.getElementsByClass('div-link')[0].children[activeLink].offsetWidth; //activeLink = 0

In my app.component.ts file:

import { Component, AfterViewInit, ViewChildren, Directive, QueryList, ElementRef} from '@angular/core';

@Directive({selector: '[class~=div-link]'})
@Directive({selector: '.div-link'}) // variant
@Directive({selector: '#divHandle'}) // variant
@Directive({selector: '[divHandle]'}) // variant
export class ChildDirective {
    constructor(elem: ElementRef){}

    selector: 'my-app',
export class AppComponent implements AfterViewInit {
    @ViewChildren(ChildDirective) childrenContent: QueryList<ChildDirective>;


When I log the childrenContent I get a QueryList object, but it is empty, no elements to get info from.

I have tried several @Directive selectors and always my QueryList is empty.

Get this bounty!!!

#StackBounty: #css #svg #fonts #icons #font-awesome Custom icon in static website

Bounty: 50

I am building a static website to use as a blog with the R blogdown package which acts as a wrapper for the Hugo static website generator.

I would like to have a line of social media icons immediately underneath the title which I have achieved somewhat using the FontAwesome toolkit which was already being used by the theme I chose.

However I would like to include some icons not present in the toolkit. Some I found in the Academions project and one I made myself as a single layer SVG in Inkscape. It is a square icon for Pocket.

enter image description here

I combined them all into a custom font (called customfonts) using the Icomoon app and placed the fonts in my Hugo static/fonts directory and the CSS file in my static/css directory. I also amended the file paths in the CSS file to point to the static/fonts directory and added in style classes which are like the ones in the FontAwesome CSS file.

I call the CSS files in my page footer and have tried to insert the icons.

When I use one of the icons originally from the Academicons font like so:

<i class="cf cf-GoogleScholar cf-3x"></i>

I get the icon but when I try to insert my custom icon like so:

<i class="cf-pocket-square cf-3x"></i>

I do not get the icon displayed.

When I inspect the HTML I can see it in the code.
enter image description here

enter image description here

There must therefore be something wrong with the SVG I made. However I do not know what that is or how to fix it.

I have placed the SVG I made, the CSS file and the font files in this directory.

How can I get my icon to display?

EDIT: I have added a MWE to the directory linked above.

Here is the HTML:

<html class="wf-opensans-i3-active wf-opensans-i7-active wf-opensans-n3-active wf-opensans-n7-active wf-breeserif-n4-active wf-active" lang="en-us">
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css">
    <link rel="stylesheet" href="./customfonts.css">
    This one works:
This one with my cusom icon does not:
</body> </html>

This is what the output looks like:

enter image description here

This is what the top of the CSS file looks like:

@font-face {
  font-family: 'customfonts';
  src:  url('./customfonts.eot?7cqlun');
  src:  url('./customfonts.eot?7cqlun#iefix') format('embedded-opentype'),
    url('./customfonts.ttf?7cqlun') format('truetype'),
    url('./customfonts.woff?7cqlun') format('woff'),
    url('./customfonts.svg?7cqlun#customfonts') format('svg');
  font-weight: normal;
  font-style: normal;

.cf {
    font:normal normal normal 14px/1 customfonts;

.cf-pocket-square .path1:before {
  content: "e900";
  color: rgb(0, 0, 0);
.cf-pocket-square .path2:before {
  content: "e901";
  margin-left: -1em;
  color: rgb(0, 0, 0);
.cf-pocket-square .path3:before {
  content: "e902";
  margin-left: -1em;
  color: rgb(255, 255, 255);
.cf-GoogleScholar:before {
  content: "e903";

+ style classes ...

Get this bounty!!!

#StackBounty: #css #button #jquery-mobile jQuery mobile 1.4.5 and custom button image

Bounty: 300

I need to use custom png instead of default search icon of jQuery mobile.

The code I have for default button is following

<a href='@Url.Action("Search", "Home")' class="ui-btn ui-btn-icon-right ui-icon-search ui-btn-icon-notext ui-corner-all">Search</a>

I try to redefine the CSS like this

.ui-icon-search { 
    50% 50% no-repeat!important; 

I see the image but cannot get rid of the theme CSS design.

enter image description here

Get this bounty!!!

#StackBounty: How to Change .popover-content CSS for ui-bootstrap popover

Bounty: 50

I am using the ui-bootstrap popover to list some notifications in my application.
I am using the uib-popover-template to design the content of the popover.

I would like to change the padding settings for each elements inside the popover.

I have tried using the popover-class attribute, but this just configures the CSS for the overall popover, and not the elements contained inside – this is what the .popover-content CSS class seems to govern.

Here is the html for the popover:

<span class="glyphicon glyphicon-globe" uib-popover-template="'myNotifications.html'"

Additionally, I don’t want to do this just by doing:

.popover-content {
     margin: 0px;

as I have used popovers in multiple places throughout my application and don’t want them all to get their CSS redefined.

Can anyone tell me how to change this in the correct manner? All help much appreciated…

EDIT 1: I’ve tried to do as suggested in the comments by makshh and use CSS selectors to modify the ‘.popover-content’ class. This class is a div contained within the parent ‘.popover’ class.

I tried to do this with the following:

.my-notifications-popover {
    margin-left: 0px;

.my-notifications-popover div {
    margin-left: 0px;

This should make the margin-left zero for all child divs of .my-notifications-popover which should be applied to the popover. However it doesn’t seem to be applied at all. This approach may not be ideal since it would set the margin for all divs below the popover which I may not want. Is there a way to specifically target the .popover-content class specifically using the CSS selectors?

I’ve created a plnkr to show exactly how this is not working…. You can see it here: https://plnkr.co/edit/Lr43L5b0YUbZEa5Zkvso

Get this bounty!!!

How to create a Custom ADF Component

In this tutorial, we will create a custom ADF Component.

Create new files and package structure as shown:

Create a Custom ADF Component

Source Code of the required files is as below:

Final Output:

Create a Custom ADF Component

When and how much to mix technologies for a project?

The main idea behind using a technology is to harness the power of code re-usability and libraries that have already been worked on and trusted to be working and functional with minimal or no issues.

The term “Technology” does not just refer to Java or C++ or JavaScript. It also refers to the frameworks that can be used to suffice some or the other requirements with minimum cost and minimal effort investment. One example can be any Application Development Framework Like Oracle ADF, Pega or Drupal, etc. The framework itself provides functionalities that are most common and also takes cares of the issues that people face while developing an application.

Any application which has to be developed from scratch needs a lot of work just to be useful enough to be used in Production environment. Basic Non-functional requirements such as MVC Architecture, Security safeguards, Application Performance, etc. are the basic and most common features of the application. In addition, Secure Login, User Registration and authentication, role mapping and similar features are also mandatory features of the application.

Most frameworks provide features such as configurable work flows, built in UI Elements, security aspects and many other features. Features such as SQL Escaping, HTML Tag Escaping and MVC Pattern architecture are generally already inbuilt to the framework. The developers can simply configure the workflows, create screens and corner out application logic and then the application is good to go.

But is that enough that we may need??

This the main question that we need to ask when trying to select technologies and try to mix them to achieve the application requirement. The Case study can be a sample B-2-B Application say Business-2-Go (B2G).

Advantage of Techs to be selected:

The B2G can be based on 3 major technology products namely an Identity Management System, an Application Development Framework, and a Content Management Service. The technologies in combination provide the architecture to harness the features out of the box.

The IDM would provide Session Maintenance, Role Mappings, Access Authentications and invalid access handling.

CMS on the other hand takes care of the static content of the application. This technology handles the application content which needs to be configurable but would be changed in very rare scenarios. The main usefulness lies in the fact that the CMS portal can be exposed to the customer admin team as well and be comfortable as the code base will not be touched by the Non Development User.

The ADF constitutes to the application flow of the B2G. All user interactions and other business logic is handled by this technology. The flexibility of the framework helps create applications quickly and more efficiently than the older technologies/frameworks such as J2EE Servlets/JSP or struts and so on.

Further technologies like JavaScript, jQuery, CSS have been used to achieve the look and feel that was decided by the client.

Disadvantages of Techs to be selected:

The disadvantages or rather limitations of the tech or the team using the tech is the one that decides whether the tech can be used or not.

The major factors can be:

  • Cost: The technology that has been perfected and supported may be in most cases be licensed. Thus incurring costs to the budget of the project. The alternative may be using Open Source technologies/frameworks. But there the problem exists of the credibility of the source, issue support and whether documentation is enough or not.
  • Resource Availability: Assuming that the cost barrier of the license has been overcome. Now the major concern is whether the resources for the technology are available or not. If not, then can existing resources be trained or can new resources can be acquired. Again the cost factor is affected in this concern.
  • Technology Limitations: Technologies have limitations in themselves also. The limitation may not be a feature that cannot be achieved, but the effort that may be involved in achieving the feature. A simple example may be a particular look and feel of a B2G. Many of the UI Elements may or may not be achievable with the selected core ADF. Or even if they are achievable, it is after a lot of R&D or with lot of hit and trials. Though this is not something that may rule out the technology itself, but may be enough to include other technologies like jQuery into the picture.
  • Interfacing efforts: While mixing technologies, spots/hooks need to be found where 1 tech may latch on to or may be placed in with the other. For example, jQuery is an Independent Tech and in the selected ADF, generally has an internal client side scripts are functioning on its own end. There may be provisions which execute scripts that achieve the UI functionalities. Similarly the CMS may not have stable out of the box connectors to code layer of the application. Thus interfaces are written to implement make this possible. This effort may also turn out to be a concern for using a tech.

An example of tech selection may be PHP. The technology PHP can also be used for creating a complete application and 99% of the same application can be achieved using PHP frameworks. In fact the cost of the tech is 0 (Open Source) and resource costing would be way lower than those of licensed application framework. But the efforts and timescale needed to achieve all the functionalities required will be humongous. Thus ruling out the tech.

Another concern that can be raised is how much the technologies can be mixed. Surely each of the frameworks will be providing some or the other comfort or a feature. Even if they are published in open source or you may have license available. Does that mean that all technologies should be mixed..??

Interfacing technologies uses effort. It also invokes limitations. An example may be the various attempts to integrate popular front-end framework like AngularJS with Oracle ADF. Oracle ADF is a mainly a Server Side Technology, maintaining all functionalities server side and providing a wide palette of features for an application. AngularJS on the other hand is a completely UI framework. It is completely Client Side Intensive Tech. Both frameworks are completely in the opposite directions. Both are unaware of the other. There are blogs showing way how to integrate both the technologies. But all can point out the issues in the integration. This is a small example, but scaling this, similar issues may be faced and thus may be counted as factors in Tech Selection.

In Conclusion, the trade-offs govern the selections of the technologies to be used in a project. Proper selections must be made in order to plan out the architecture. Improper selection may lead to issues, crashes, late deliveries or redundant costs.


Image: https://www.systrends.com/sites/default/files/banner/appdev_banner2.jpg