Omnibus commited on
Commit
9cd9dba
1 Parent(s): 15934d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -88,12 +88,13 @@ def details_fn(query):
88
  <div class='im_container'>
89
  """
90
  images = soup.findAll('img')
91
- for img in images:
92
  if not img['src'].startswith("data:"):
 
93
  link_list.append(img['src'])
94
  image_out += f"""
95
  <div class='im_each'>
96
- <img onclick="func('{img['src']}')" src={img['src']}>
97
  </div>
98
  """
99
  print (img['src'])
@@ -168,8 +169,11 @@ def format_t(inp):
168
  return out
169
 
170
  load_js = """
171
- func = function(a) {
172
  console.log(a);
 
 
 
173
  return[a];
174
  }
175
  """
 
88
  <div class='im_container'>
89
  """
90
  images = soup.findAll('img')
91
+ for i,img in enumerate(images):
92
  if not img['src'].startswith("data:"):
93
+ im_id = f'img_{i}'
94
  link_list.append(img['src'])
95
  image_out += f"""
96
  <div class='im_each'>
97
+ <img id="img_{i}" onclick="func('{img['src']}','img_{i}')" src={img['src']}>
98
  </div>
99
  """
100
  print (img['src'])
 
169
  return out
170
 
171
  load_js = """
172
+ func = function(a,b) {
173
  console.log(a);
174
+ console.log(b);
175
+ var vv = document.getElementById(b);
176
+ vv.style.background=red;
177
  return[a];
178
  }
179
  """