Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<head>
  <meta charset="utf-8">
  <base href="https://polygit.org/components/">
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
</head>
<body>
<dom-module id="x-element">
<template>
  <style></style>
  
  <template is="dom-repeat"
            id="page"
            items="[[queries]]"
            >
    <iron-media-query id="query"
                      full
                      query="[[item]]"
                      query-matches="{{queryMatches}}"
                      >
      <span hidden>{{queryResult(index)}}</span>
    </iron-media-query>
  </template>
</template>
<script>
  (function(){
    Polymer({
      is: "x-element",
      properties: {
        queryMatches: Boolean,
        queries: {
          type: Object,
          value: function() {
            return [
              '(max-width:  699px)'                         ,
              '(min-width:  700px) AND (max-width:  899px)' ,
              '(min-width:  900px) AND (max-width: 1124px)' ,
              '(min-width: 1125px)'                         ,
            ];
          },
        },
      },
      queryResult: function(index) {
        this.set('mediaWidth', index);
        console.log('mediaWidth', this.mediaWidth);
        console.log('queryMatches', this.queryMatches);
      },
    });
  })();
</script>
</dom-module>
<x-element></x-element>
</body>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers