Stripe Refund Api Tutorial Example From Scratch 0

Stripe Refund Api Tutorial Example

Today, We want to share with you Stripe Refund Api Tutorial Example.In this post we will show you stripe connect api, hear for stripe cancel subscription refund we will give you demo and example for implement.In this post, we will learn about stripe cancel subscription using curl in php with an example.

Stripe Refund Api Tutorial Example

There are the Following The simple About Stripe Refund Api Tutorial Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop stripe cancel subscription At Period End using curl php, so the Stripe Authentication with Connect using PHP for this example is following below.

$ch = Stripe_Charge::retrieve('ch_19DAkJDKgNbxQsQZsCDh98La');
$ch->refunds->create(array('amount' => 100));

How to do refund in Stripe PHP?

You can also do refund as below

\Stripe\Stripe::setApiKey("sk_test_kfjdIFNOtvieiPAKAvc9qFwJ");

 $refund = \Stripe\Refund::create([
            'charge' => 'ch_19DAkJDKgNbxQsQZsCDh98La',
            'amount' => 1000,  // For 10 $
            'reason' => 'refund'
        ]);

$balanceLiveTransaction = \Stripe\BalanceTransaction::retrieve($refund->balance_transaction);

stripe cancel subscription using curl in php

stripe cancel subscriptionCanceling subscriptions Example

curl https://api.stripe.com/v1/subscriptions/sub_B49U3PAKAINFO8Onp \
   -u sk_test_kfjdIFNOtvieiPAKAvc9qFwJ: \
   -X DELETE

Source Code for stripe cancel subscription using curl in php
function delete_curl($path)
{
    // Add Stripe your key
    $headers = array('Authorization: Bearer sk_test_kfjdIFNOtvieiPAKAvc9qFwJ');
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_URL, $path);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $result = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
    curl_close($ch);
    return $result;
}
 //Stripe Refund Api Tutorial Example
// add your simple subscriptions id
$path = "https://api.stripe.com/v1/subscriptions/sub_B49U3PAKAINFO8Onp";
$delete_curl = delete_curl($path);
echo "<pre>";
print_r($delete_curl);
echo "</pre>";

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Stripe Refund Api Tutorial Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel JSON Encode Decode Handling 0

Laravel JSON Encode Decode Handling

Today, We want to share with you Laravel JSON Encode Decode Handling.In this post we will show you Convert and Loop through JSON with Laravel, hear for get data from json array in Laravel 5.7 we will give you demo and example for implement.In this post, we will learn about get the data from an array of JSONarray from Laravel 5.7 with an example.

Laravel JSON Encode Decode Handling

There are the Following The simple About Laravel JSON Encode Decode Handling Full Information With Example and source code.

As I will cover this Post with live Working example to develop Handling JSON Data in Laravel 5.7, so the laravel 5.7 return view with json data for this example is following below.

JSON encoded database column

[{
    "title": "Vuejs",
    "points": 0,
    "tags": [{
        "type": "Core",
        "uid": 45
    }]
}, {
    "title": "Angularjs",
    "points": 2,
    "tags": [{
        "type": "MVC",
        "uid": 1
    }]
}]

Laravel 5.7 – Get specific array in JSON encoded database column

$postData = json_decode($post->data, true);
dd($postData);

json decode laravel controller

Laravel Decode JSON

foreach (json_decode($response) as $area)
{
	print_r($area);
}

Encoding JSON Data

<?php
// An associative array
$marks = array("Vuejs"=>65, "Laravel"=>80, "PHP"=>78, "Angularjs"=>90);
 
echo json_encode($marks);
?>

Decoding JSON Data

<?php
$json = '{"Vuejs":65,"Laravel":80,"PHP":78,"Angularjs":90}';
 
var_dump(json_decode($json));
?>

Laravel Controller and Route Setup

create a new controller in Laravel 5.7

php artisan make:controller HomeController

# app/Http/Controllers/HomeController.php
...
use App\Product;

class HomeController extends Controller
{
    public function getProducts() {
        $products = Product::all();
        return $products;
    }
}

Formatting JSON data in Laravel

json_encode() to simple way to encode arrays into JSON string format.

$array = array('JavaScript','Magento','Vuejs');
return json_encode($array);

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel JSON Encode Decode Handling.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

PHP Image Rotate Resize and Save Examples 0

PHP Image Rotate Resize and Save

Today, We want to share with you PHP Image Rotate Resize and Save.In this post we will show you php resizing image on upload rotates, hear for Manipulating Images in PHP Using GD we will give you demo and example for implement.In this post, we will learn about php rotate image without quality loss with an example.

PHP Image Rotate Resize and Save

There are the Following The simple About PHP Image Rotate Resize and Save Full Information With Example and source code.

As I will cover this Post with live Working example to develop Open Image, rotate, resize and save, so the Rotate and Save an image using PHP for this example is following below.

Example for PNG File:

<?php
    $uploadFilenm = "pakainfo25041992.png";
    $degrees = 90;
    $orignal_file = imagecreatefrompng($uploadFilenm);
    $rotate = imagerotate($orignal_file, $degrees, 0);
    imagepng($rotate, "changeUpdatFile.png");
    print_r('Your Live Image/Files saved successfully.');
?>

Example for JPEG File:

<?php
    
    $uploadFilenm = "pakainfo25041992.jpeg";
    $degrees = 90;
    $orignal_file = imagecreatefromjpeg($uploadFilenm);
    $rotate = imagerotate($orignal_file, $degrees, 0);
    imagejpeg($rotate, "changeUpdatFile.jpeg");
    print_r('Your Live Image/Files saved successfully.');
   
?>

Open Image, rotate, resize and save

<?php
   if(isset($_FILES['image'])){
      $dynamicErr= array();
      $orignal_file = $_FILES['image']['name'];
      $file_size =$_FILES['image']['size'];
      $file_tmp =$_FILES['image']['tmp_name'];
      $file_type=$_FILES['image']['type'];
      $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
 
      $expensions= array("jpeg","jpg","png");
      
      if(in_array($file_ext,$expensions)=== false){
         $dynamicErr[]="extension not Any allowed, please select a JPEG or PNG file.";
      }
      
      if($file_size > 2097152){
         $dynamicErr[]='File size must be excately 2 MB';
      }
      
      if(empty($dynamicErr)==true){
         move_uploaded_file($file_tmp, $orignal_file);
         echo "Success";
      }else{
         print_r($dynamicErr);
      }

      $uploadFilenm = $orignal_file;
      $exif = exif_read_data($uploadFilenm);
      if(!empty($exif['Orientation'])) {
         switch($exif['Orientation']) {
                    case 8:
                        $degree = 90;
                        break;
                    case 3:
                        $degree = 180;
                        break;
                    case 6:
                        $degree = -90;
                        break;
                }
      $source = imagecreatefromjpeg($uploadFilenm) or notfound();
      $rotate = imagerotate($source,$degree,0);

      imagejpeg($rotate,$uploadFilenm);

      imagedestroy($source);
      imagedestroy($rotate);
      }

      echo '<img src="'.$orignal_file.'">';
   }
?>
<html>
   <body>
      
      <form action="" method="POST" enctype="multipart/form-data">
         <input type="file" name="image" />
         <input type="submit"/>
      </form>
      
   </body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Image Rotate Resize and Save.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Dynamic QR codes Generator in Laravel 5.7 0

Dynamic QR codes Generator in Laravel 5.7

Today, We want to share with you Dynamic QR codes Generator in Laravel 5.7.In this post we will show you laravel 5.7 qr code generator example, hear for simple qr code generator laravel we will give you demo and example for implement.In this post, we will learn about qr code generator in laravel 5.7 with an example.

Dynamic QR codes Generator in Laravel 5.7

There are the Following The simple About Dynamic QR codes Generator in Laravel 5.7 Full Information With Example and source code.

As I will cover this Post with live Working example to develop simple-qrcode laravel example, so the Design QR Code generator for this example is following below.

Step 1: Install Laravel 5.7

Simple Laravel 5.7 Latest version Install step by step in CMD(werneckbh/laravel-qr-code)

composer create-project --prefer-dist laravel/laravel atmiya25

Step 2: Install Laravel qrcode Package

simple-qrcode plugin use in Laravel 5.7

composer require simplesoftwareio/simple-qrcode

config/app.php

'providers' => [
	....
	SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class
],
'aliases' => [
	....
	'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class
],

Step 3: Create a Laravel Route

routes/web.php

<?php
Route::get('qr-code-g', function () {
  \QrCode::size(500)
            ->format('png')
            ->generate('pakainfo.com', public_path('images/qrcode.png'));
    
  return view('qrCode');
    
});

Step 4: Create Laravel 5.7 Blade file

resources/views/qrCode.blade.php

<!DOCTYPE html>
<html>
<head>
	<title>Simple Laravel 5.7 - QR Code Generator Example : Pakainfo.com</title>
</head>
<body>
    
<div class="visible-print text-center">
	<h1>Laravel 5.7 - QR Code Generator Demo - Pakainfo.com</h1>
    {!! QrCode::size(250)->generate('pakainfo.com'); !!}
     
    <p>example by www.pakainfo.com.</p>
</div>
    
</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Dynamic QR codes Generator in Laravel 5.7.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel ajax get Request Example From Scratch 0

Laravel ajax get Request Example From Scratch

Today, We want to share with you Laravel ajax get Request Example From Scratch.In this post we will show you Create Live Search In Laravel Using AJAX, hear for Laravel 5.7 Jquery Ajax Request Example From Scratch we will give you demo and example for implement.In this post, we will learn about AJAX call to a Laravel controller function / method with an example.

Laravel ajax get Request Example From Scratch

There are the Following The simple About Laravel ajax get Request Example From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel 5.7 Ajax GET and POST examples, so the Laravel 5.7 AJAX GET and show new data for this example is following below.

Step 1 : Define a Laravel Routes

Add Routes for Ajax Request:routes/web.php

Route::get('productGetReq', '[email protected]');
Route::post('productGetReq', '[email protected]');

Step 2: Create a Laravel Controller methods:

app/Http/Controllers/ProductController.php

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ProductController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function productGetReq()
    {
        return view('productGetReq');
    }
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function productGetReqPost()
    {
        $input = request()->all();
        return response()->json(['success'=>'Get All the Product Simple jQuery Ajax Request.']);
    }
}

Step 3 : Create Laravel Blade File:

resources/views/productGetReq.blade.php

<!DOCTYPE html>
<html>
<head>
    <title>pakainfo.com - Laravel 5.7 Ajax Request example</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
    <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<body>
    <div class="container">
        <h1>Create Live Search In Laravel Using AJAX - Pakainfo.com</h1>
        <form >
            <div class="form-group pakainfo">
                <label>Name:</label>
                <input type="text" name="name" class="form-control" placeholder="Name" required="">
            </div>
            <div class="form-group pakainfo">
                <label>company:</label>
                <input type="company" name="company" class="form-control" placeholder="company" required="">
            </div>
            <div class="form-group pakainfo">
                <strong>Qty:</strong>
                <input type="text" name="qty" class="form-control" placeholder="Qty" required="">
            </div>
            <div class="form-group pakainfo">
                <button class="btn btn-success save-product btn-submit">Submit</button>
            </div>
        </form>
    </div>
</body>
<script type="text/javascript">
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    $(".save-product").click(function(e){
        e.preventDefault();
        var name = $("input[name=name]").val();
        var company = $("input[name=company]").val();
        var qty = $("input[name=qty]").val();
        $.ajax({
           type:'POST',
           url:'/productGetReq',
           data:{name:name, company:company, qty:qty},
           success:function(data){
              alert(data.success);
           }
        });
	});
</script>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel ajax get Request Example From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Laravel Autocomplete Live Search from database 0

Laravel Autocomplete Live Search from database using jQuery

Today, We want to share with you Laravel Autocomplete Live Search from database using jQuery.In this post we will show you Manual Laravel Autocomplete search from Database, hear for Laravel 5.7 Autocomplete Search from Database using Typeahead JS we will give you demo and example for implement.In this post, we will learn about Laravel Bootstrap Typeahead Autocomplete Search from Database with an example.

Laravel Autocomplete Live Search from database using jQuery

There are the Following The simple About Laravel Autocomplete Live Search from database using jQuery Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel 5.7 autocomplete search with typeahead.js, so the laravel 5.7 autocomplete from database for this example is following below.

Step 1:- Create Laravel the migration

command line and type

php artisan make:model tbl_data -m

structure of my migration

public function up()
{
	Schema::create('products', function (Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->string('slug');
		$table->timestamps();
	});
}

Step 2 : create a view resources/views

resources/views/autocomplete.blade.php

<html>
<head>
    <title>
       Laravel 5.7 jQUery Auto Complete - Pakainfo.com</title>
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
   <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
   <style>

       * {
        margin: 0px auto; !important /* Aligning all the data to center */
    }
</style>

</head>
<body>
<h3>Laravel 5.7 Autocomplete Search from Database using Typeahead JS Example</h3>
    <div class="container" style="margin-top: 10px;">
        <div align="center">
            <div class="row">
                <div class="col-md-6">
                    <div class="row">
                        <div class="col-md-12">
                            <form action="">
                                <div class="form-group">
                                    <div class="ui-widget">
                                        <label for="">Search for Anything</label>
                                        <input id="searchString" type="text" name="search_string" placeholder="Enter Search String" class="form-control" />
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </center>
    </div>

    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
</body>
</html>

jQuery Code

Laravel Autocomplete Search from database using jQuery Source code

$( function() {
          $( "#searchString" ).autocomplete({
            //html : html,
            source: "display-search-queries",
            minLength: 1,
            select:function(e,ui) { 
                location.href = ui.item.link;
            }
        } );
      } );

Define a Laravel Route

Route::get('/','[email protected]');

Route::get('display-search-queries','[email protected]');

Step 3: Create Laravel Controller

ProductController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Response;
use DB;

class ProductController extends Controller
{
    public function index() {
        return view('autocomplete');
    }

    public function autoCompleteSearch(Request $request) {
        $querystr = $request->get('querystr');
    	$data = DB::table('products')->where("title","LIKE","%$querystr%")->select('title as value','slug as link')->get();
        return response()->json($data);
    }
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel Autocomplete Live Search from database using jQuery.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Fixed Position Elements in CSS Examples 0

Fixed Position Elements in CSS Examples

Today, We want to share with you Fixed Position Elements in CSS Examples.In this post we will show you position fixed relative to parent, hear for position fixed inside position absolute we will give you demo and example for implement.In this post, we will learn about an element with position: fixed; is positioned relative with an example.

Fixed Position Elements in CSS Examples

There are the Following The simple About Fixed Position Elements in CSS Examples Full Information With Example and source code.

As I will cover this Post with live Working example to develop css position relative to parent, so the image position html for this example is following below.

Example 1: Pure CSS FIXED POSITION ELEMENTS

.center_verticaly{
   position:fixed;
   top:50%;
   -webkit-transform:translate(-50%);
   -moz-transform:translate(-50%);
   -o-transform:translate(-50%);
   -ms-transform:translate(-50%);
   transform: translate(-50%);
}
 
.center_vertically_and_horizontaly{
   position:fixed;
   top:50%;
   left:50%
   -webkit-transform:translate(-50%,-50%);
   -moz-transform:translate(-50%,-50%);
   -o-transform:translate(-50%,-50%);
   -ms-transform:translate(-50%,-50%);
   transform: translate(-50%,-50%);
}

Example 2: Fixed position but relative to container

HTML Part

<div id="fixedContainer">
</div>
<div style="height:1000px;background-color:#bbb;"></div>

CSS Part

#fixedContainer
{
  background-color:#3d3d3d;
  position: fixed;
  width: 200px;
  height: 100px;
  left: 50%;
  top: 0%;
  margin-left: -100px; /*half the width*/
}

Example 3: Create Fixed Elements with CSS

Step #1. The HTML

<div class="block">
    Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.
</div>

Step #2. The CSS

.block {
    position: fixed;
    background: #2184cd;
    color: #fff;
    padding: 20px;
    width: 400px;
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Fixed Position Elements in CSS Examples & position fixed inside position absolute.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

CSS Sticky Footer Tutorial Example From Scratch 0

CSS Sticky Footer Tutorial Example From Scratch

Today, We want to share with you CSS Sticky Footer Tutorial Example From Scratch.In this post we will show you fixed footer overlaps content, hear for make div stick to bottom of parent we will give you demo and example for implement.In this post, we will learn about keep footer at bottom of page when scrolling with an example.

CSS Sticky Footer Tutorial Example From Scratch

There are the Following The simple About CSS Sticky Footer Tutorial Example From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop responsive sticky footer, so the css tricks sticky for this example is following below.

Creating a Sticky Footer

Step 1: HTML Part

<body>
  <main><main>
  <footer></footer>
</body>

Step 1: Pure CSS Part

main {
  min-height: calc(100vh - 50px);
}
footer {
  height: 50px;
}

Step 3: JavaScript Part

function set_main_height(){
   var footerHeight = $('footer').innerHeight();
   $('main').css('min-height','100vh -'+footerHeight);
}
 
$(function() { 
  set_main_height();
  window.resize(function(){
    set_main_height();
  });
});

Simple Sticky Footer Examples

Example 1: Sticky Footer with Negative Margin

HTML Part

<div class="content">
  <h1>Sticky Footer with Negative Margin 1</h1>
  <p><button id="add">Include Data</button></p>
  <div class="push"></div>
</div>

<footer class="footer">
  Footer 
</footer>

CSS Part
html, body {
  height: 100%;
  margin: 0;
}
.content {
  padding: 20px;
  min-height: 100%;
  margin: 0 auto -50px;
}
.footer,
.push {
  height: 50px;
}


js Part
$("#add").on("click", function() {
  $("<p>Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.</p>").insertBefore(".push");
});

Example 2: Sticky Footer Navbar Template for Bootstrap

HTML Part

<div class="content">
  <div class="content-inside">
    <h1>Sticky Footer Navbar Template for Bootstrap</h1>
    <p><button id="add">Include Data</button></p>
  </div>
</div>

<footer class="footer">
  Footer 
</footer>

CSS Part
html, body {
  height: 100%;
  margin: 0;
}
.content {
  min-height: 100%;
}
.content-inside {
  padding: 20px;
  padding-bottom: 50px;
}
.footer {
  height: 50px;
  margin-top: -50px;
}

js Part
$("#add").on("click", function() {
  $("<p>Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.</p>").appendTo(".content-inside");
});

Example 3: Sticky Footer Template for Bootstrap

HTML Part

<div class="content">
  <h1>Sticky Footer with calc()</h1>
  <p><button id="add">Include Data</button></p>
</div>

<footer class="footer">
  Footer 
</footer>

CSS Part
.content {
  min-height: calc(100vh - 70px);
  padding: 40px 40px 0 40px;
}
.footer {
  height: 50px;
}

js Part
$("#add").on("click", function() {
  $("<p>Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.</p>").appendTo(".content");
});

Example 4: Adding a Sticky Footer Using CSS

HTML Part

<div class="content">
  <h1>Adding a Sticky Footer Using CSS</h1>
  <p><button id="add">Include Data</button></p>
</div>

<footer class="footer">
  Footer 
</footer>

CSS Part
html {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.content {
  flex: 1 0 auto;
  padding: 20px;
}
.footer {
  flex-shrink: 0;
  padding: 20px;
}


js Part
$("#add").on("click", function() {
  $("<p>Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.</p>").appendTo(".content");
});

Example 5: Pure CSS3 Sticky Footer

HTML Part

<div class="content">
  <h1>Pure CSS3 Sticky Footer with Grid</h1>
  <p><button id="add">Include Data</button></p>
</div>

<footer class="footer">
  Footer
</footer>

CSS Part
html {
  height: 100%;
}
body {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
}
.content {
  padding: 20px;
}
.footer {
  grid-row-start: 2;
  grid-row-end: 3;
}


* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font: 16px Sans-Serif;
}
h1 {
  margin: 0 0 20px 0;
}
p {
  margin: 0 0 20px 0;
}
.footer {
  background: #42A5F5;
  color: white;
  padding: 20px;
}

js Part
$("#add").on("click", function() {
  $("<p>Welcome to PakaInfo – a blog where you will learn about General Information, Jobs, Earn Money, Education, Health, Technology, Life Style, Science, Top10, Nature.
In other words, it is a community of software engineers and developers.</p>").appendTo(".content");
});

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about CSS Sticky Footer Tutorial Example From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

BOOTSTRAP ACCORDION WITH PLUS MINUS ICON 0

BOOTSTRAP ACCORDION WITH PLUS MINUS ICON EXAMPLES

Today, We want to share with you BOOTSTRAP ACCORDION WITH PLUS MINUS ICON EXAMPLES.In this post we will show you Simple Bootstrap accordion with toggle button, hear for Bootstrap expand / collapse with plus and minus we will give you demo and example for implement.In this post, we will learn about add plus minus symbol to a bootstrap accordion with an example.

BOOTSTRAP ACCORDION WITH PLUS MINUS ICON EXAMPLES

There are the Following The simple About BOOTSTRAP ACCORDION WITH PLUS MINUS ICON EXAMPLES Full Information With Example and source code.

As I will cover this Post with live Working example to develop bootstrap 4 accordion with plus minus icon, so the add plus minus symbol to a bootstrap accordion for this example is following below.

Example 1: Bootstrap expand / collapse with plus and minus

Step 1 : HTML Part

<div class="container ">
 
    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
 
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="groupOne">
                <h4 class="panel-title">
                    <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                        <i class="plus-minus glyphicon glyphicon-plus"></i>
                        Product Group Item #1
                    </a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="groupOne">
                <div class="panel-body">
                     
                </div>
            </div>
        </div>
 
        <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="headingTwo">
                <h4 class="panel-title">
                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                        <i class="plus-minus glyphicon glyphicon-plus"></i>
                        Product Group Item #2
                    </a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                <div class="panel-body">
                     
                </div>
            </div>
        </div>
 
    </div><!-- panel-group -->
      
</div><!-- container -->

Step 2 : javascript Part

$(function() {
  function toggleIcon(e) {
      $(e.target)
          .prev('.panel-heading')
          .find(".plus-minus")
          .toggleClass('glyphicon-plus glyphicon-minus');
  }
  $('.panel-group').on('hidden.bs.collapse', toggleIcon);
  $('.panel-group').on('shown.bs.collapse', toggleIcon);
 
});

Full Example of the Expand Collapse Div Plus Minus Using jQuery

Example 2: jQuery Accordion with Plus and Minus Toggle

Step 1: HTML Part

<div class="accordion_container">
  <div class="accordion_head">First Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>First Accordian Body, it will have description</p>
  </div>
  <div class="accordion_head">Second Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>Second Accordian Body, it will have description</p>
  </div>
  <div class="accordion_head">Third Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>Third Accordian Body, it will have description</p>
  </div>
</div>

<div class="accordion_container">
  <div class="accordion_head">First Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>First Accordian Body, it will have description</p>
  </div>
  <div class="accordion_head">Second Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>Second Accordian Body, it will have description</p>
  </div>
  <div class="accordion_head">Third Accordian Head<span class="plusminus">+</span></div>
  <div class="accordion_body" style="display: none;">
    <p>Third Accordian Body, it will have description</p>
  </div>
</div>

Step 2: jQuery Part

$(document).ready(function() {
  //toggle the component with class accordion_body
  $(".accordion_head").click(function() {
    if ($('.accordion_body').is(':visible')) {
      $(".accordion_body").slideUp(300);
      $(".plusminus").text('+');
    }
    if ($(this).next(".accordion_body").is(':visible')) {
      $(this).next(".accordion_body").slideUp(300);
      $(this).children(".plusminus").text('+');
    } else {
      $(this).next(".accordion_body").slideDown(300);
      $(this).children(".plusminus").text('-');
    }
  });
});

Step 3: CSS Part

.accordion_container {
  width: 500px;
}

.accordion_head {
  background-color: skyblue;
  color: white;
  cursor: pointer;
  font-family: arial;
  font-size: 14px;
  margin: 0 0 1px 0;
  padding: 7px 11px;
  font-weight: bold;
}

.accordion_body {
  background: lightgray;
}

.accordion_body p {
  padding: 18px 5px;
  margin: 0px;
}

.plusminus {
  float: right;
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about BOOTSTRAP ACCORDION WITH PLUS MINUS ICON EXAMPLES.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Bootstrap collapse plus minus sign Examples 0

Bootstrap collapse plus minus sign

Today, We want to share with you Bootstrap collapse plus minus sign.In this post we will show you bootstrap accordion with plus minus, hear for Accordion with plus minus icon toggle pure css we will give you demo and example for implement.In this post, we will learn about add plus minus symbol to a bootstrap accordion with an example.

Bootstrap collapse plus minus sign

There are the Following The simple About Bootstrap collapse plus minus sign Full Information With Example and source code.

As I will cover this Post with live Working example to develop bootstrap collapse panel with icon example, so the jquery accordion with plus minus for this example is following below.

create bootstrap accordion with plus minus icons

create index.html file and add Copy and paste this source code: Toggle Bootstrap Accordion With Plus Minus Icons on Header Link Click Example

<body>
    
<div class="bs-example">
    <h2>Bootstrap accordion with plus minus icons</h2>
    <div class="panel-group" id="accordion">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"><span class="glyphicon glyphicon-plus"></span> PHP Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse">
                <div class="panel-body">
                    <p>PHP Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/programming/php/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"><span class="glyphicon glyphicon-plus"></span> Laravel Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse in">
                <div class="panel-body">
                    <p>Laravel Server side Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/laravel/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree"><span class="glyphicon glyphicon-plus"></span> Angularjs Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseThree" class="panel-collapse collapse">
                <div class="panel-body">
                    <p>An Angularjs Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/angularjs/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
    </div>
    <p><strong>Note:</strong> Click on the Any linked heading menu text to expand or collapse accordion panels using CSS.</p>
</div>
</body>

Include CDN libs

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

style.css

    .bs-example{
        margin: 20px;
    }
    .panel-title .glyphicon{
        font-size: 14px;
    }

main.js

<script>
    $(document).ready(function(){
        $(".collapse.in").each(function(){
            $(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
        });
        $(".collapse").on('show.bs.collapse', function(){
            $(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
        }).on('hide.bs.collapse', function(){
            $(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
        });
    });
</script>

Full example Source Code:


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>create bootstrap accordion with plus minus icons</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
    .bs-example{
        margin: 20px;
    }
    .panel-title .glyphicon{
        font-size: 14px;
    }
</style>
<script>
    $(document).ready(function(){
        $(".collapse.in").each(function(){
            $(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
        });
        $(".collapse").on('show.bs.collapse', function(){
            $(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
        }).on('hide.bs.collapse', function(){
            $(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
        });
    });
</script>
</head>
<body>
    
<div class="bs-example">
    <h2>Bootstrap accordion with plus minus icons</h2>
    <div class="panel-group" id="accordion">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"><span class="glyphicon glyphicon-plus"></span> PHP Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse">
                <div class="panel-body">
                    <p>PHP Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/programming/php/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"><span class="glyphicon glyphicon-plus"></span> Laravel Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse in">
                <div class="panel-body">
                    <p>Laravel Server side Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/laravel/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree"><span class="glyphicon glyphicon-plus"></span> Angularjs Tutorials with Example</a>
                </h4>
            </div>
            <div id="collapseThree" class="panel-collapse collapse">
                <div class="panel-body">
                    <p>An Angularjs Step By Step Full Example, Demo with Tutorils. <a href="https://pakainfo.com/jobs/technology/angularjs/" target="_blank">Learn more.</a></p>
                </div>
            </div>
        </div>
    </div>
    <p><strong>Note:</strong> Click on the Any linked heading menu text to expand or collapse accordion panels using CSS.</p>
</div>
</body>
</html>                                                                                                  

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Bootstrap collapse plus minus sign.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.